react-native-navigation的迁移库

RNNViewControllerTests.m 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ////
  2. //// RNNViewControllerTests.m
  3. ////
  4. //// Created by Ran Greenberg on 26/12/2016.
  5. //// Copyright © 2016 Facebook. All rights reserved.
  6. ////
  7. //
  8. //#import <XCTest/XCTest.h>
  9. //#import "RCCManager.h"
  10. //#import "RNNViewController.h"
  11. //#import "MMDrawerController.h"
  12. //
  13. //#define COMMAND_SINGLE_SCREEN_APP @"singleScreenApp"
  14. //#define COMMAND_TAB_BASED_APP @"tabBasedApp"
  15. //#define COMMAND_SINGLE_WITH_LEFT_SIDE_MENU @"singleWithLeftSideMenu"
  16. //#define COMMAND_SINGLE_WITH_RIGHT_SIDE_MENU @"singleWithRightSideMenu"
  17. //#define COMMAND_SINGLE_WITH_BOTH_SIDE_MENU @"singleWithBothMenus"
  18. //#define COMMAND_TAB_BASED_WITH_SIDE_MENT @"tabBasedWithSideMenu"
  19. //
  20. //
  21. //@interface RNNViewControllerTests : XCTestCase
  22. //@property (nonatomic, strong) RCTBridge *bridge;
  23. //@property (nonatomic, strong) NSDictionary *jsonCommands;
  24. //@end
  25. //
  26. //@implementation RNNViewControllerTests
  27. //
  28. //- (void)setUp {
  29. // [super setUp];
  30. // // Put setup code here. This method is called before the invocation of each test method in the class.
  31. // self.bridge = [[RCCManager sharedInstance] getBridge];
  32. // self.jsonCommands = [self loadCommandsJsonAsDictionary];
  33. //}
  34. //
  35. //- (void)tearDown {
  36. // // Put teardown code here. This method is called after the invocation of each test method in the class.
  37. // self.bridge = nil;
  38. // self.jsonCommands = nil;
  39. // [super tearDown];
  40. //}
  41. //
  42. //-(NSDictionary*)loadCommandsJsonAsDictionary {
  43. // NSString *filePath = [[NSBundle mainBundle] pathForResource:@"commands" ofType:@"json"];
  44. // NSData *data = [NSData dataWithContentsOfFile:filePath];
  45. // NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
  46. // return json;
  47. //}
  48. //
  49. //- (void)testWrongSyntax {
  50. //
  51. // NSDictionary *layout = @{@"key": @"com.example.FirstTabScreen"};
  52. // id vc = [RNNViewController controllerWithLayout:layout bridge:self.bridge];
  53. // XCTAssertNil(vc);
  54. //}
  55. //
  56. //-(void)testSingleScreenApp {
  57. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_SINGLE_SCREEN_APP] bridge:self.bridge];
  58. // XCTAssertTrue([vc isKindOfClass:[UINavigationController class]]);
  59. //}
  60. //
  61. //-(void)testTabBasedApp {
  62. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_TAB_BASED_APP] bridge:self.bridge];
  63. // XCTAssertTrue([vc isKindOfClass:[UITabBarController class]]);
  64. // UITabBarController *tabsController = (UITabBarController*)vc;
  65. // for (id tab in tabsController.viewControllers) {
  66. // XCTAssertTrue([tab isKindOfClass:[UINavigationController class]]);
  67. // }
  68. //}
  69. //
  70. //-(void)testSingleWithLeftSideMenu {
  71. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_SINGLE_WITH_LEFT_SIDE_MENU] bridge:self.bridge];
  72. // XCTAssertTrue([vc isKindOfClass:[MMDrawerController class]]);
  73. // MMDrawerController *sideMenuLeft = (MMDrawerController*)vc;
  74. // XCTAssertNotNil(sideMenuLeft.leftDrawerViewController);
  75. // XCTAssertNotNil(sideMenuLeft.centerViewController);
  76. // XCTAssertNil(sideMenuLeft.rightDrawerViewController);
  77. //}
  78. //
  79. //-(void)testSingleWithRightSideMenu {
  80. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_SINGLE_WITH_RIGHT_SIDE_MENU] bridge:self.bridge];
  81. // XCTAssertTrue([vc isKindOfClass:[MMDrawerController class]]);
  82. // MMDrawerController *sideMenuRight = (MMDrawerController*)vc;
  83. // XCTAssertNil(sideMenuRight.leftDrawerViewController);
  84. // XCTAssertNotNil(sideMenuRight.centerViewController);
  85. // XCTAssertNotNil(sideMenuRight.rightDrawerViewController);
  86. //
  87. //}
  88. //
  89. //-(void)testSingleWithBothSideMenu {
  90. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_SINGLE_WITH_BOTH_SIDE_MENU] bridge:self.bridge];
  91. // XCTAssertTrue([vc isKindOfClass:[MMDrawerController class]]);
  92. // MMDrawerController *sideMenuBoth = (MMDrawerController*)vc;
  93. // XCTAssertNotNil(sideMenuBoth.leftDrawerViewController);
  94. // XCTAssertNotNil(sideMenuBoth.centerViewController);
  95. // XCTAssertNotNil(sideMenuBoth.rightDrawerViewController);
  96. //}
  97. //
  98. //-(void)testTabBasedWithBothSideMenu {
  99. // id vc = [RNNViewController controllerWithLayout:self.jsonCommands[COMMAND_TAB_BASED_WITH_SIDE_MENT] bridge:self.bridge];
  100. // XCTAssertTrue([vc isKindOfClass:[MMDrawerController class]]);
  101. // MMDrawerController *sideMenuBothWithTabs = (MMDrawerController*)vc;
  102. // XCTAssertNotNil(sideMenuBothWithTabs.leftDrawerViewController);
  103. // XCTAssertNotNil(sideMenuBothWithTabs.centerViewController);
  104. // XCTAssertNotNil(sideMenuBothWithTabs.rightDrawerViewController);
  105. // XCTAssertTrue([sideMenuBothWithTabs.centerViewController isKindOfClass:[UITabBarController class]]);
  106. //}
  107. ////- (void)testPerformanceExample {
  108. //// // This is an example of a performance test case.
  109. //// [self measureBlock:^{
  110. //// // Put the code you want to measure the time of here.
  111. //// }];
  112. ////}
  113. //
  114. //@end