|
@@ -17,45 +17,57 @@
|
17
|
17
|
}
|
18
|
18
|
|
19
|
19
|
|
20
|
|
-//- (void)testShowOverlayShouldAddWindowWithVCAsRoot {
|
21
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
22
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
23
|
|
-// XCTAssertTrue([window.rootViewController isEqual:_overlayVC]);
|
24
|
|
-//}
|
25
|
|
-//
|
26
|
|
-//- (void)testShowOverlayShouldAddVisibleWindow {
|
27
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
28
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
29
|
|
-// XCTAssertTrue(window.windowLevel == UIWindowLevelNormal);
|
30
|
|
-// XCTAssertFalse(window.hidden);
|
31
|
|
-//}
|
32
|
|
-//
|
33
|
|
-//- (void)testDismissOverlayShouldCleanWindowRootVC {
|
34
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
35
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
36
|
|
-// [_overlayManager dismissOverlay:_overlayVC];
|
37
|
|
-// XCTAssertNil(window.rootViewController);
|
38
|
|
-//}
|
39
|
|
-//
|
40
|
|
-//- (void)testDismissOverlayShouldHideWindow {
|
41
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
42
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
43
|
|
-// [_overlayManager dismissOverlay:_overlayVC];
|
44
|
|
-// XCTAssertTrue(window.hidden);
|
45
|
|
-//}
|
46
|
|
-//
|
47
|
|
-//- (void)testDismissOverlayShouldRemoveOverlayWindow {
|
48
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
49
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
50
|
|
-// [_overlayManager dismissOverlay:_overlayVC];
|
51
|
|
-// XCTAssertFalse([_overlayManager.overlayWindows containsObject:window]);
|
52
|
|
-//}
|
53
|
|
-//
|
54
|
|
-//- (void)testDismissOverlayShouldNotRemoveWrongVC {
|
55
|
|
-// [_overlayManager showOverlay:_overlayVC];
|
56
|
|
-// UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
57
|
|
-// [_overlayManager dismissOverlay:[UIViewController new]];
|
58
|
|
-// XCTAssertTrue([_overlayManager.overlayWindows containsObject:window]);
|
59
|
|
-//}
|
|
20
|
+- (void)testShowOverlayShouldAddWindowWithVCAsRoot {
|
|
21
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
22
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
23
|
+ XCTAssertTrue([window.rootViewController isEqual:_overlayVC]);
|
|
24
|
+}
|
|
25
|
+
|
|
26
|
+- (void)testShowOverlayShouldAddVisibleWindow {
|
|
27
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
28
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
29
|
+ XCTAssertTrue(window.windowLevel == UIWindowLevelNormal);
|
|
30
|
+ XCTAssertFalse(window.hidden);
|
|
31
|
+}
|
|
32
|
+
|
|
33
|
+- (void)testShowOverlayShouldCreateTransparentView {
|
|
34
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
35
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
36
|
+ XCTAssertTrue(window.rootViewController.view.backgroundColor == [UIColor clearColor]);
|
|
37
|
+}
|
|
38
|
+
|
|
39
|
+- (void)testShowOverlayShouldNotBeKeyWindow {
|
|
40
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
41
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
42
|
+ XCTAssertFalse(window.keyWindow);
|
|
43
|
+}
|
|
44
|
+
|
|
45
|
+- (void)testDismissOverlayShouldCleanWindowRootVC {
|
|
46
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
47
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
48
|
+ [_overlayManager dismissOverlay:_overlayVC];
|
|
49
|
+ XCTAssertNil(window.rootViewController);
|
|
50
|
+}
|
|
51
|
+
|
|
52
|
+- (void)testDismissOverlayShouldHideWindow {
|
|
53
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
54
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
55
|
+ [_overlayManager dismissOverlay:_overlayVC];
|
|
56
|
+ XCTAssertTrue(window.hidden);
|
|
57
|
+}
|
|
58
|
+
|
|
59
|
+- (void)testDismissOverlayShouldRemoveOverlayWindow {
|
|
60
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
61
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
62
|
+ [_overlayManager dismissOverlay:_overlayVC];
|
|
63
|
+ XCTAssertFalse([_overlayManager.overlayWindows containsObject:window]);
|
|
64
|
+}
|
|
65
|
+
|
|
66
|
+- (void)testDismissOverlayShouldNotRemoveWrongVC {
|
|
67
|
+ [_overlayManager showOverlay:_overlayVC];
|
|
68
|
+ UIWindow* window = _overlayManager.overlayWindows.lastObject;
|
|
69
|
+ [_overlayManager dismissOverlay:[UIViewController new]];
|
|
70
|
+ XCTAssertTrue([_overlayManager.overlayWindows containsObject:window]);
|
|
71
|
+}
|
60
|
72
|
|
61
|
73
|
@end
|