3

I want to access Private Method or Variable in Test class.??

1 Answer 1

12

Read about and use the @TestVisble annotation.

From the documentation:

Use the TestVisible annotation to allow test methods to access private or protected members of another class outside the test class. These members include methods, member variables, and inner classes. This annotation enables a more permissive access level for running tests only. This annotation doesn’t change the visibility of members if accessed by non-test classes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .