Trying to test for navigationBar colour of a table view controller. I've set the barTintColor of the navigationController in the table view controller.
I have written the following test:
- (void)testNavBarColourOfMasterViewController
{
VAGMasterViewController *mvc = [[VAGMasterViewController alloc] init];
[mvc view];
XCTAssertEqualObjects([[[mvc navigationController] navigationBar] barTintColor], [UIColor whiteColor]);
}
Error:
test failure: -[VAGMasterViewControllerTests testNavBarColourOfMasterViewController] failed: (([[[mvc navigationController] navigationBar] barTintColor]) equal to ([UIColor whiteColor])) failed: ("(null)") is not equal to ("UIDeviceWhiteColorSpace 1 1")
Apparently when I try to read the colour of the barTintColor it is null. How can this be if it's set in viewDidLoad in the controller?
Kind regards.