Activity Forums Salesforce® Discussions Does It make any difference to declaring a test method as public or private

  • Does It make any difference to declaring a test method as public or private

    Posted by MOHIT on May 13, 2020 at 3:15 pm

    Does It make any difference to declaring a test method as public or private in Salesfoce?

    Anjali replied 4 years, 7 months ago 4 Members · 3 Replies
  • 3 Replies
  • Aditya

    Member
    May 13, 2020 at 5:47 pm

    YES, It makes difference.

  • Sumit

    Member
    May 14, 2020 at 6:43 am

    Test Method Syntax
    The visibility of a test method doesn't matter, so declaring a test method as public or private doesn't make a difference as the testing framework is always able to access test methods. ... Test methods must be defined in test classes, which are classes annotated with isTest .

  • Anjali

    Member
    May 14, 2020 at 10:15 am

    There is no difference in declaring a test method as public or private. the testing framework can access the test method.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos