Test if Frc’s fetch fails then sut’s log is called.

This commit is contained in:
NicholasTD07
2014-03-09 12:53:17 +08:00
parent b14fe736d7
commit f80bc3a7be
6 changed files with 65 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
#import "NTDCoreDataTableViewController.h"
// Collaborators
#import "NTDFakeCDTVC.h"
#import "NTDFakeFetchedResultsController.h"
#import "NTDFakeTableView.h"
@@ -58,4 +59,16 @@
XCTAssertTrue([(NTDFakeTableView *)sut.tableView reloadDataIsCalled]);
}
- (void)testLogIfFRCsFetchFailed
{
// given
sut = [[NTDFakeCDTVC alloc] init];
sut.fetchedResultsController = [[NTDFakeFetchedResultsController alloc] init];
// when
[(NTDFakeCDTVC *)sut setFetchWillFail:NO];
[sut performFetch];
// then
XCTAssertTrue([(NTDFakeCDTVC *)sut loggedFailure]);
}
@end