Salesforce Platform Developer I (legacy) — Question 38
Which three statements are true regarding the @isTest annotation? (Choose three.)
Answer options
- A. A method annotated @isTest(SeeAllData=true) in a class annotated @isTest(SeeAllData=false) has access to all org data.
- B. A method annotated @isTest(SeeAllData=false) in a class annotated @isTest(SeeAllData=true) has access to all org data.
- C. A class containing test methods counts toward the Apex code limit regardless of any @isTest annotation.
- D. Products and Pricebooks are visible in a test even if a class is annotated @isTest(SeeAllData=false).
- E. Profiles are visible in a test even if a class is annotated @isTest(SeeAllData=false).
Correct answer: A, B, E
Explanation
The correct answers, A, B, and E, are true because the @isTest annotation can control data visibility based on its parameters. A method with @isTest(SeeAllData=true) can access all org data regardless of the class annotation, while profiles are always visible in tests even when @isTest(SeeAllData=false) is used. Options C and D are incorrect because the presence of test methods does not affect the Apex code limit, and Products and Pricebooks are not visible if the class is annotated @isTest(SeeAllData=false).