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 44 discussion

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

What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

  • A. Account0.Phone=333-8781, Account1.Phone=333-8780
  • B. Account0.Phone=888-1515, Account1.Phone=999-2525
  • C. Account0.Phone=333-8780, Account1.Phone=333-8781
  • D. Account0.Phone=888-1515, Account1.Phone=999-1515
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Anterey
Highly Voted 4 years ago
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));
upvoted 45 times
...
1vanTT
Highly Voted 1 year, 6 months ago
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
upvoted 8 times
chucksback
1 year, 2 months ago
this is good to know. can't believe i missed this
upvoted 1 times
...
...
galvaroe
Most Recent 3 months, 2 weeks ago
None of the answers are correct
upvoted 1 times
...
irishD
1 year, 2 months ago
no correct answer
upvoted 2 times
...
skhan6525
1 year, 2 months ago
Correct Answer is B ->> 888-1515, Account1.Phone=888-2525
upvoted 1 times
...
Pfar07
1 year, 4 months ago
All answers are incorrect. Phone = '333-878' for both Accounts because that is how it is initialized in the method to setup data.
upvoted 3 times
...
vancika
1 year, 8 months ago
Selected Answer: C
The correct answer is C but the question is missing +i for the Phone
upvoted 5 times
...
smoota
1 year, 9 months ago
Sorry: Shouldn't the Answer be: Account0.Phone=999-1515, Account1.Phone=888-2525 (which is also not available?)
upvoted 1 times
...
smoota
1 year, 9 months ago
Shouldn't the Answer be: Account0.Phone=888-1515, Account1.Phone=888-2525 (which is not available?)
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 ...