Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 373 discussion

Actual exam question from Salesforce's CRT-450
Question #: 373
Topic #: 1
[All CRT-450 Questions]

Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

  • A. The @testSetup annotation is not supported when the @isTest(SeeAllData=True) annotation is used.
  • B. Records created in the test setup method cannot be updated in individual test methods.
  • C. A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.
  • D. In a test setup method, test data is inserted once and made available for all test methods in the test class.
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
SanjeevOnForce
1 year ago
A,D is correct as the @TestMethod is defined once is a test call
upvoted 3 times
...
irina_735
1 year, 1 month ago
Selected Answer: AD
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm
upvoted 3 times
...
BrucePark
1 year, 4 months ago
Selected Answer: AC
Should be AC. Testsetup consumes governor limits but it resets when test.starttest is called.
upvoted 1 times
irina_735
1 year, 1 month ago
In a test setup method, test data is inserted once fo all test methods. After each test metod they are rolled back. So C is incorrect. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...