nerdexam
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

PDII question #307 exhibit 1
PDII question #307 exhibit 2

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)
  • A
    10% (2)
  • B
    5% (1)
  • C
    80% (16)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full PDII Practice