nerdexam
Salesforce

CRT-450 · Question #148

A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?

The correct answer is C. @TestSetup. See the full explanation below for the reasoning.

Question

A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?

Options

  • A@BeforeTest
  • B@isTest(SeeAllData=True)
  • C@TestSetup
  • D@PreTest

How the community answered

(51 responses)
  • A
    4% (2)
  • B
    10% (5)
  • C
    73% (37)
  • D
    14% (7)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice