Salesforce
CRT-450 · Question #159
How should a developer write unit tests for a private method in an Apex class?
The correct answer is C. Use the TestVisible annotation. See the full explanation below for the reasoning.
Question
How should a developer write unit tests for a private method in an Apex class?
Options
- AUse the SeeAllData annotation.
- BAdd a test method in the Apex class.
- CUse the TestVisible annotation.
- DMark the Apex class as global.
How the community answered
(32 responses)- A16% (5)
- B6% (2)
- C72% (23)
- D6% (2)
Community Discussion
No community discussion yet for this question.