Salesforce
PDII · Question #329
PDII Question #329: Real Exam Question with Answer & Explanation
Sign in or unlock PDII to reveal the answer and full explanation for question #329. The question stem and answer options stay visible for context.
Question
A developer wrote a class named AccountHistoryManager that relies on field history tracking. The class has a static method called getAccountHistory that takes in an Account as a parameter and returns a list of associated AccountHistory object records. The following test fails: What should be done to make this test pass?
Exhibit
Options
- AThe test method should be deleted since this code cannot be tested.
- BCreate AccountHistory records manually in the test setup and write a query to get them.
- CUse Test.isRunningTest() in getAccountHistory() to conditionally return fake AccountHistory
- DUse @isTest (SeeAllData=true) to see historical data from the org and query for AccountHistory
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.
