|
@@ -79,7 +79,20 @@
|
79
|
79
|
|
80
|
80
|
}
|
81
|
81
|
|
|
82
|
+- (void)testStackRoot_navigationControllerNilShouldThrow {
|
|
83
|
+ [self.nvc setViewControllers:@[self.vc1]];
|
|
84
|
+ self.nvc.willReturnVCs = @[self.vc1];
|
|
85
|
+
|
|
86
|
+ XCTAssertThrowsSpecificNamed([self.uut setRoot:self.vc2 fromComponent:nil completion:nil], NSException, @"StackNotFound");
|
|
87
|
+}
|
82
|
88
|
|
83
|
|
-
|
|
89
|
+- (void)testStackRoot_shouldUpdateNavigationControllerChildrenViewControllers {
|
|
90
|
+ self.nvc.willReturnVCs = @[self.vc1, self.vc2, self.vc3];
|
|
91
|
+
|
|
92
|
+ [self.uut setRoot:self.vc2 fromComponent:@"vc1" completion:nil];
|
|
93
|
+
|
|
94
|
+ XCTAssertEqual(self.nvc.viewControllers.lastObject, self.vc2);
|
|
95
|
+ XCTAssertEqual(self.nvc.viewControllers.count, 1);
|
|
96
|
+}
|
84
|
97
|
|
85
|
98
|
@end
|