nerdexam
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)
  • A
    16% (5)
  • B
    6% (2)
  • C
    72% (23)
  • D
    6% (2)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice