mirror of
https://github.com/zhigang1992/NTDCoreDataTableViewController.git
synced 2026-04-22 18:33:18 +08:00
Test if Frc’s fetch fails then sut’s log is called.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user