I'm unit testing one of my view controllers and wanted to confirm that when a logic branch is hit, the modal view controller that I pop up with present:
viewDidLoad
MWLoginViewController *loginController = [[MWLoginViewController alloc] init];
[self presentModalViewController:loginController animated:YES];
The code is hit in the debugger when I put a breakpoint.
Now how do I test to see if this was launched?
I am trying:
BOOL wasLoginViewController = [[mainVcSUT presentedViewController] isMemberOfClass: [MWLoginViewController class]];
[Assert isTrue:wasLoginViewController];
NSLog(@"presented VC was: %@", [[mainVcSUT presentedViewController] class]);
The NSLog
is telling me view controller was null
.