What is the optimal...
 
Notifications
Clear all

What is the optimal way to fix this?

1 Posts
1 Users
0 Likes
31 Views
Rolando
(@bulluckrolando)
Noble Member
Joined: 7 months ago
Posts: 341
Topic starter  

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.
  • 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.
  • D . Add Test.startTest() before and Test.stopTest() after insert acct

Show Answer Hide Answer

Suggested Answer: A

   
Quote
Share: