Valid DEX-450 Dumps shared by ExamDiscuss.com for Helping Passing DEX-450 Exam! ExamDiscuss.com now offer the newest DEX-450 exam dumps, the ExamDiscuss.com DEX-450 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com DEX-450 dumps with Test Engine here:
Which two statements are true about using the @testSetup annotation in an Apex test class? Choose 2 answers
Correct Answer: C,D
Option C: In a test setup method, test data is inserted once and made available for all test methods in the test class. True. The @testSetup method runs once before any test methods in the class. Test data created in this method is available to all test methods, promoting code reuse and efficiency. Reference: Option D: The @testSetup annotation is not supported when the @isTest(SeeAllData=True) annotation is used. True. The @testSetup method is not supported in test classes annotated with @isTest(SeeAllData=true). Using SeeAllData=true accesses existing organization data, conflicting with the isolation provided by @testSetup. Option A: A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits. False. The @testSetup method executes only once per test class, not once per test method. It does count towards the per-test-class limits but improves overall test performance. Option B: Records created in the test setup method cannot be updated in individual test methods. False. Records created in a @testSetup method can be queried and modified within individual test methods. This allows tests to manipulate shared test data as needed. Conclusion: The correct statements are C and D, as they accurately describe the behavior and restrictions of the @testSetup annotation.