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 5 years, 8 months ago 4 Members · 3 Replies
  • 3 Replies
  • Aditya

    Member
    May 13, 2020 at 5:47 PM

    YES, It makes difference.

  • Sumit kumar

    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