Salesforce
PDII · Question #6
PDII Question #6: Real Exam Question with Answer & Explanation
Sign in or unlock PDII to reveal the answer and full explanation for question #6. The question stem and answer options stay visible for context.
Question
An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?
Options
- AVerify the user has permissions passing a user into System.runAs().
- BCall the Apex class method from a testMethod instead of the testSetup method.
- CAdd @testVisible to the method in the class the developer is testing.
- DUse system.assert() in testSetup to verify the values are being returned.
Unlock PDII to see the answer
You've previewed enough free PDII questions. Unlock PDII for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.