A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code?
Choose 2 answers
Suggested Answer: C, D
Get Premium DEX-450 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
12 comments · newest first
BI
Billy
3 months ago
But A seems tempting too. Using seeAllData could save time.
KI
Kina
3 months ago
Agreed! D is efficient for bulk data.
GE
Gerri
3 months ago
I think D is the best choice. It’s straightforward.
EL
Ellsworth
4 months ago
B doesn't really apply here, right? Just stick to D!
TA
Talia
4 months ago
Wait, can you really use Test.loadData for this? Sounds too easy!
IR
Irene
4 months ago
I thought using static resources was the best practice?
TA
Tanja
5 months ago
A is a bad idea, it can mess with your test isolation.
MA
Maryanne
6 months ago
D is definitely the way to go for bulk testing!
LA
Lavelle
6 months ago
I feel like creating a static resource for test data might be overkill for just 200 records, but I could be wrong.
BE
Belen
7 months ago
I practiced a similar question where we had to create bulk test data, and I think using Test.loadData is the way to go for efficiency.
ST
Starr
7 months ago
I think using @isTest (seeAllData=true) is generally discouraged, but I can't recall why exactly.
BE
Bethanie
7 months ago
I remember we discussed how using Test.loadData can simplify creating test records, but I'm not sure if it's the best option here.