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)- A9% (2)
- B74% (17)
- C4% (1)
- D13% (3)
Community Discussion
No community discussion yet for this question.