Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
That’s nearly everything, but we need to tie up a few loose ends before we can call the app complete. Well, some of them seem more like “glaring mistakes” than “loose ends,” but we’ll come to that later.
To start with, the QuestionListTableDataSource needs to know which notification center instance to use when the user selects a question in the list, and the BrowseOverflowViewController doesn’t currently tell it. It should, and we can require that with a test on BrowseOverflowViewControllerTests:
- (void)testViewControllerHooksUpQuestionListNotificationCenterInViewDidAppear {
QuestionListTableDataSource *questionDataSource =
[[QuestionListTableDataSource alloc] init];
viewController.dataSource = questionDataSource;
[viewController viewDidAppear: YES];
STAssertEqualObjects(questionDataSource.notificationCenter,
[NSNotificationCenter defaultCenter], @"");
}