nerdexam
Salesforce

CRT-450 · Question #13

A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test?

The correct answer is B. Use Test.loadDataO < > and reference a CSV file in a static resource. See the full explanation below for the reasoning.

Question

A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test?

Options

  • AUse Anonymous Apex to create the required data.
  • BUse Test.loadDataO < > and reference a CSV file in a static resource.
  • CUse SOQL to query the org for the required data.
  • DUse Test.loadDataO and reference a JSON file in Documents.

How the community answered

(23 responses)
  • A
    9% (2)
  • B
    74% (17)
  • C
    4% (1)
  • D
    13% (3)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice