May 2019
Intermediate to advanced
546 pages
12h 41m
English
This is the code for the unit test:
@IsTestprivate static void selectIncorrectMovie(){ // start up your test scenario Test.startTest(); MovieExtension ext = new MovieExtension(null); Test.stopTest(); // verify if the Id of the movie is the same movieId in your controller System.assertEquals(null, ext.movieId);}
The updated code (which was changed, as per the logic) is as follows:
public MovieExtension(Apexpages.StandardController stdMovie){ if (stdMovie != null) { this.movieId = stdMovie.getId(); }}
Read now
Unlock full access