ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 32 - Certified Platform Developer II discussion

Report
Export

The test method above calls an @future method that increments the Number_of_Times_Viewed__c value. The assertion is failing because the Number_of_Times_Viewed__c equals 0. What is the optimal way to fix this?

A.
Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
Answers
A.
Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
B.
Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).
Answers
B.
Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).
C.
Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
Answers
C.
Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
D.
Add Test.startTest() before and Test.stopTest() after insert acct
Answers
D.
Add Test.startTest() before and Test.stopTest() after insert acct
Suggested answer: A
asked 23/09/2024
Raed Alshehri
50 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first