I have following code to test if view is properly configured(among others, I have the monthScrollview
placed as a subview of view:
@implementation ECBrowserViewControllerTests
-(void)setUp
{
//-deviceSpecific simply adds suffix like '_iPad'
main=[[ECBrowserViewController alloc] initWithNibName:[@"ECBrowserViewController" deviceSpecific] bundle:nil];
}
-(void)testOutlets
{
STAssertNotNil(main.view, @"View outlet not set!");
STAssertNotNil(main.monthScrollView, @"no month scrollview");
STAssertTrue(main.monthScrollView.pagingEnabled, @"Paging should be enabled");
}
-(void)testPaging
{
STAssertNotNil(main.monthScrollView, @"no month scrollview");
STAssertTrue(main.monthScrollView.pagingEnabled, @"Paging should be enabled");
}
@end
Could any one tell me why the testPaging
fails, while testOutlets
succeeds? I figured out that's about checking the parentView first, but why?
I'm using Xcode 4.6.3 and builtin SenTestingKit