react-native-navigation的迁移库

RNNSideMenuControllerTest.m 1.6KB

123456789101112131415161718192021222324252627282930313233
  1. #import <XCTest/XCTest.h>
  2. #import "RNNSideMenuController.h"
  3. #import "RNNRootViewController.h"
  4. @interface RNNSideMenuControllerTest : XCTestCase
  5. @property (nonatomic, strong) RNNSideMenuController *uut;
  6. @property (nonatomic, strong) RNNSideMenuChildVC *centerVC;
  7. @property (nonatomic, strong) RNNSideMenuChildVC *leftVC;
  8. @property (nonatomic, strong) RNNSideMenuChildVC *rightVC;
  9. @end
  10. @implementation RNNSideMenuControllerTest
  11. - (void)setUp {
  12. [super setUp];
  13. _leftVC = [[RNNSideMenuChildVC alloc] initWithLayoutInfo:nil childViewControllers:@[[RNNRootViewController new]] options:nil defaultOptions:nil presenter:nil type:RNNSideMenuChildTypeLeft];
  14. _rightVC = [[RNNSideMenuChildVC alloc] initWithLayoutInfo:nil childViewControllers:@[[RNNRootViewController new]] options:nil defaultOptions:nil presenter:nil type:RNNSideMenuChildTypeRight];
  15. _centerVC = [[RNNSideMenuChildVC alloc] initWithLayoutInfo:nil childViewControllers:@[[RNNRootViewController new]] options:nil defaultOptions:nil presenter:nil type:RNNSideMenuChildTypeCenter];
  16. self.uut = [[RNNSideMenuController alloc] initWithLayoutInfo:nil childViewControllers:@[_leftVC, _centerVC, _rightVC] options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil];
  17. }
  18. - (void)testSetSideMenuWidthShouldUpdateLeftReactViewFrameWidth {
  19. [self.uut side:MMDrawerSideLeft width:100];
  20. XCTAssertEqual(self.uut.left.child.view.frame.size.width, 100.f);
  21. }
  22. - (void)testSetSideMenuWidthShouldUpdateRightReactViewFrameWidth {
  23. [self.uut side:MMDrawerSideRight width:150];
  24. XCTAssertEqual(self.uut.right.child.view.frame.size.width, 150.f);
  25. }
  26. @end