|
@@ -40,16 +40,15 @@
|
40
|
40
|
XCTAssertNotEqualObjects(vc2, ans);
|
41
|
41
|
}
|
42
|
42
|
|
43
|
|
-- (void)testFindContainerForId_setNilContainerId {
|
|
43
|
+- (void)testSetContainer_setNilContainerId {
|
44
|
44
|
NSString *containerId1 = nil;
|
45
|
45
|
UIViewController *vc1 = [UIViewController new];
|
46
|
|
- [self.store setContainer:vc1 containerId:containerId1];
|
|
46
|
+ XCTAssertThrows([self.store setContainer:vc1 containerId:containerId1]);
|
|
47
|
+ XCTAssertNil([self.store findContainerForId:containerId1]);
|
47
|
48
|
|
48
|
|
- UIViewController *ans = [self.store findContainerForId:containerId1];
|
49
|
|
- XCTAssertNil(ans);
|
50
|
49
|
}
|
51
|
50
|
|
52
|
|
-- (void)testFindContainerForId_setDoubleContainerId {
|
|
51
|
+- (void)testSetContainer_setDoubleContainerId {
|
53
|
52
|
NSString *containerId1 = @"cntId1";
|
54
|
53
|
|
55
|
54
|
UIViewController *vc1 = [UIViewController new];
|
|
@@ -62,6 +61,20 @@
|
62
|
61
|
XCTAssertThrows([self.store setContainer:vc2 containerId:containerId1]);
|
63
|
62
|
}
|
64
|
63
|
|
|
64
|
+- (void)testRemoveContainer_removeExistContainer {
|
|
65
|
+ NSString *containerId1 = @"cntId1";
|
|
66
|
+ UIViewController *vc1 = [UIViewController new];
|
|
67
|
+
|
|
68
|
+ [self.store setContainer:vc1 containerId:containerId1];
|
|
69
|
+
|
|
70
|
+ UIViewController *ans = [self.store findContainerForId:containerId1];
|
|
71
|
+ XCTAssertEqualObjects(vc1, ans);
|
|
72
|
+
|
|
73
|
+ [self.store removeContainer:containerId1];
|
|
74
|
+
|
|
75
|
+ XCTAssertNil([self.store findContainerForId:containerId1]);
|
|
76
|
+}
|
|
77
|
+
|
65
|
78
|
|
66
|
79
|
|
67
|
80
|
@end
|