react-native-navigation的迁移库

RNNTabBarControllerTest.m 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. #import <XCTest/XCTest.h>
  2. #import "RNNTabBarController.h"
  3. #import "RNNNavigationOptions.h"
  4. #import "RNNViewControllerPresenter.h"
  5. @interface RNNTabBarControllerTest : XCTestCase
  6. @property (nonatomic, strong) RNNTabBarController *uut;
  7. @end
  8. @implementation RNNTabBarControllerTest
  9. - (void)setUp {
  10. [super setUp];
  11. self.uut = [[RNNTabBarController alloc] initWithLayoutInfo:nil childViewControllers:@[[[UIViewController alloc] init]] options:[[RNNNavigationOptions alloc] initWithDict:@{}] presenter:[[RNNViewControllerPresenter alloc] init]];
  12. }
  13. - (void)testInitWithLayoutInfo_shouldBindPresenter {
  14. XCTAssertNotNil(self.uut.presenter);
  15. }
  16. - (void)testInitWithLayoutInfo_shouldSetMultipleViewControllers {
  17. UIViewController* vc1 = [[UIViewController alloc] init];
  18. UIViewController* vc2 = [[UIViewController alloc] init];
  19. self.uut = [[RNNTabBarController alloc] initWithLayoutInfo:nil childViewControllers:@[vc1, vc2] options:[[RNNNavigationOptions alloc] initWithDict:@{}] presenter:[[RNNViewControllerPresenter alloc] init]];
  20. XCTAssertTrue(self.uut.viewControllers.count == 2);
  21. }
  22. @end