May 2019
Intermediate to advanced
546 pages
12h 41m
English
The second part of our test method is the scenario. Based on the preceding movie, the movie standard controller is the parameter that we need to provide in our constructor. So, we need to create a standard controller (this is a part of the ApexPages class) of that movie and pass this to the constructor of our controller.
Watch out—this is our test scenario, so we start with the following line of code:
Test.startTest();
This line of code assigns a new set of limits to our unit test. We need to know whether we hit some Salesforce limitations during the test. This line of code is always necessary if you perform unit tests for the asynchronous Apex. Otherwise, the code for the asynchronous calls will not be executed.
The code ...
Read now
Unlock full access