Salesforce
PDII · Question #307
A developer wrote the following method to find all the test accounts in the org: However, the test method below fails. What should be used to fix this failing test?
The correct answer is C. Test.fixedSearchResults() method to set up expected data. See the full explanation below for the reasoning.
Question
A developer wrote the following method to find all the test accounts in the org:
However, the test method below fails. What should be used to fix this failing test?
Exhibits
Options
- ATest.loadData to set up expected data
- B@isTear(SeeAllData=true) to access org data for the test
- CTest.fixedSearchResults() method to set up expected data
- D@testSetup method to set up expected data
How the community answered
(20 responses)- A10% (2)
- B5% (1)
- C80% (16)
- D5% (1)
Community Discussion
No community discussion yet for this question.

