Salesforce
PDII · Question #208
How should a developer assert that a trigger with an asynchronous process has successfully run?
The correct answer is B. Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform. See the full explanation below for the reasoning.
Question
How should a developer assert that a trigger with an asynchronous process has successfully run?
Options
- ACreate all test data, use @future in the test class, then perform assertions
- BCreate all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform
- CInsert records into Salesforce, use seeAllData=true, then perform assertions
- DCreate all test data in the test class, use System.runAs() to invoke the trigger, then perform
How the community answered
(37 responses)- A5% (2)
- B73% (27)
- C14% (5)
- D8% (3)
Community Discussion
No community discussion yet for this question.