the for loop on the setup() method (line 6) is missing some code..
testAccs.add(new Account(Name = 'MyTestAccount'+i, Phone='333-878'));
should be
testAccs.add(new Account(Name = 'MyTestAccount'+i, Phone='333-878'+i));
All answers are incorrect. The correct output is Account0.Phone=333-878, Account1.Phone=333-878. The original values for records created in the @TestSetup section are available to each test method. Any changes made in a test method are rolled back after each test method execution so that each test method has access to the original values.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_testsetup.htm
Shouldn't the Answer be:
Account0.Phone=888-1515, Account1.Phone=888-2525 (which is not available?)
upvoted 1 times
...
Log in to ExamTopics
Sign in:
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.
Anterey
Highly Voted 4 years ago1vanTT
Highly Voted 1 year, 6 months agochucksback
1 year, 2 months agogalvaroe
Most Recent 3 months, 2 weeks agoirishD
1 year, 2 months agoskhan6525
1 year, 2 months agoPfar07
1 year, 4 months agovancika
1 year, 8 months agosmoota
1 year, 9 months agosmoota
1 year, 9 months ago