How do I use XCTest to test if a navigationBar is not set to a specific colour in objective-C?
问题 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