react-native-navigation的迁移库

RNNOverlayManagerTest.m 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #import <XCTest/XCTest.h>
  2. #import "RNNOverlayManager.h"
  3. @interface RNNOverlayManagerTest : XCTestCase
  4. @property (nonatomic, retain) RNNOverlayManager* overlayManager;
  5. @property (nonatomic, retain) UIViewController* overlayVC;
  6. @end
  7. @implementation RNNOverlayManagerTest
  8. - (void)setUp {
  9. [super setUp];
  10. _overlayManager = [RNNOverlayManager new];
  11. _overlayVC = [UIViewController new];
  12. }
  13. //- (void)testShowOverlayShouldAddWindowWithVCAsRoot {
  14. // [_overlayManager showOverlay:_overlayVC];
  15. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  16. // XCTAssertTrue([window.rootViewController isEqual:_overlayVC]);
  17. //}
  18. //
  19. //- (void)testShowOverlayShouldAddVisibleWindow {
  20. // [_overlayManager showOverlay:_overlayVC];
  21. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  22. // XCTAssertTrue(window.windowLevel == UIWindowLevelNormal);
  23. // XCTAssertFalse(window.hidden);
  24. //}
  25. //
  26. //- (void)testDismissOverlayShouldCleanWindowRootVC {
  27. // [_overlayManager showOverlay:_overlayVC];
  28. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  29. // [_overlayManager dismissOverlay:_overlayVC];
  30. // XCTAssertNil(window.rootViewController);
  31. //}
  32. //
  33. //- (void)testDismissOverlayShouldHideWindow {
  34. // [_overlayManager showOverlay:_overlayVC];
  35. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  36. // [_overlayManager dismissOverlay:_overlayVC];
  37. // XCTAssertTrue(window.hidden);
  38. //}
  39. //
  40. //- (void)testDismissOverlayShouldRemoveOverlayWindow {
  41. // [_overlayManager showOverlay:_overlayVC];
  42. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  43. // [_overlayManager dismissOverlay:_overlayVC];
  44. // XCTAssertFalse([_overlayManager.overlayWindows containsObject:window]);
  45. //}
  46. //
  47. //- (void)testDismissOverlayShouldNotRemoveWrongVC {
  48. // [_overlayManager showOverlay:_overlayVC];
  49. // UIWindow* window = _overlayManager.overlayWindows.lastObject;
  50. // [_overlayManager dismissOverlay:[UIViewController new]];
  51. // XCTAssertTrue([_overlayManager.overlayWindows containsObject:window]);
  52. //}
  53. @end