mirror of
https://github.com/zhigang1992/NTDCoreDataTableViewController.git
synced 2026-04-24 03:05:20 +08:00
Test Frc’s performFetch is called when SUT’s performFetch is called.
When Sut’s fetchedResultsController is not nil, and its performFetch is called, its fetchedResultsController’s performFetch method should be called.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// Copyright (c) 2014 Nicholas Tian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NTDCoreDataTableViewController.h"
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface NTDCoreDataTableViewControllerTests : XCTestCase
|
||||
@@ -13,6 +14,9 @@
|
||||
@end
|
||||
|
||||
@implementation NTDCoreDataTableViewControllerTests
|
||||
{
|
||||
NTDCoreDataTableViewController *sut;
|
||||
}
|
||||
|
||||
- (void)setUp
|
||||
{
|
||||
@@ -26,4 +30,14 @@
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testIfFRCIsNotNilThenFRCsPerformFetchIsCalledWhenSutsPerformFetchIsCalled
|
||||
{
|
||||
// given
|
||||
sut.fetchedResultsController = [[NSFetchedResultsController alloc] init];
|
||||
// when
|
||||
[sut performFetch];
|
||||
// then
|
||||
XCTAssertTrue(sut.fetchedResultsController.performFetchIsCalled);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user