Activity Forums Salesforce® Discussions Testing private method in Salesforce

  • Testing private method in Salesforce

    Posted by Ravi on April 30, 2016 at 10:46 am

    Why it is best practice to test private method from test class using @testVisible() annotation. Private method is called from another method of the same class, why not test by calling public method?

    • This discussion was modified 7 years, 11 months ago by  Ravi.
    • This discussion was modified 7 years, 11 months ago by  Ravi.
    • This discussion was modified 6 years, 9 months ago by  Forcetalks.
    • This discussion was modified 6 years, 9 months ago by  Forcetalks.
    S replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Ravi

    Member
    April 30, 2016 at 11:16 am

    Hi abhinav,
    I am not asking how to test private method, my question is why should we test private method while it already called by another method.

    • This reply was modified 7 years, 11 months ago by  Ravi.
  • S

    Member
    July 18, 2017 at 10:35 am

    Hi Ravi,

    Did you got the answer for this ?

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos