react-native-navigation的迁移库

RNNControllerFactoryTest.m 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // RNNControllerFactoryTest.m
  3. // playground
  4. //
  5. // Created by Ran Greenberg on 08/02/2017.
  6. // Copyright © 2017 Wix. All rights reserved.
  7. //
  8. #import <XCTest/XCTest.h>
  9. #import "RNNControllerFactory.m"
  10. @interface RNNControllerFactoryTest : XCTestCase
  11. @end
  12. @implementation RNNControllerFactoryTest
  13. - (void)setUp {
  14. [super setUp];
  15. // Put setup code here. This method is called before the invocation of each test method in the class.
  16. }
  17. - (void)tearDown {
  18. // Put teardown code here. This method is called after the invocation of each test method in the class.
  19. [super tearDown];
  20. }
  21. - (void)testCreateContainer_EmptyLayout {
  22. RNNControllerFactory *factory = [[RNNControllerFactory alloc] init];
  23. XCTAssertThrows([factory createLayout:@{}]);
  24. }
  25. - (void)testCreateContainer_ContainerLayout {
  26. id <RNNRootViewCreator> creator = nil;
  27. RNNControllerFactory *factory = [[RNNControllerFactory alloc] initWithRootViewCreator:creator];
  28. id ans = [factory createLayout:@{@"id": @"cntId",
  29. @"type": @"Container",
  30. @"data": @{},
  31. @"children": @[]}];
  32. XCTAssertTrue([ans isKindOfClass:[UIViewController class]]);
  33. }
  34. @end