react-native-navigation的迁移库

RNNBottomTabPresenterTest.m 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #import <XCTest/XCTest.h>
  2. #import "RNNBottomTabPresenter.h"
  3. @interface RNNBottomTabPresenterTest : XCTestCase
  4. @property (nonatomic, strong) RNNBottomTabPresenter *uut;
  5. @property (nonatomic, strong) RNNNavigationOptions *options;
  6. @property (nonatomic, strong) id bindedViewController;
  7. @end
  8. @implementation RNNBottomTabPresenterTest
  9. - (void)setUp {
  10. [super setUp];
  11. }
  12. //- (void)test_tabBarTextFontFamily_validFont {
  13. // UIViewController* viewController = [UIViewController new];
  14. //
  15. // NSString* inputFont = @"HelveticaNeue";
  16. // UIFont* expectedFont = [UIFont fontWithName:inputFont size:10];
  17. //
  18. // self.uut.fontFamily = inputFont;
  19. // self.uut.text = @"Tab 1";
  20. //
  21. // [self.uut rnn_set];
  22. //
  23. // NSDictionary* attributes = [viewController.tabBarItem titleTextAttributesForState:UIControlStateNormal];
  24. // XCTAssertTrue([attributes[@"NSFont"] isEqual:expectedFont]);
  25. //}
  26. //- (void)test_tabBarTextFontSize_withoutTextFontFamily_withoutTextColor {
  27. // UIViewController* viewController = [UIViewController new];
  28. //
  29. // UIFont* expectedFont = [UIFont systemFontOfSize:15];
  30. //
  31. // self.uut.fontSize = @(15);
  32. // self.uut.text = @"Tab 1";
  33. //
  34. // [self.uut applyOn:viewController];
  35. //
  36. // NSDictionary* attributes = [viewController.tabBarItem titleTextAttributesForState:UIControlStateNormal];
  37. // XCTAssertTrue([attributes[@"NSFont"] isEqual:expectedFont]);
  38. //}
  39. //
  40. //- (void)test_tabBarTextFontSize_withoutTextFontFamily {
  41. // UIViewController* viewController = [UIViewController new];
  42. //
  43. // UIFont* expectedFont = [UIFont systemFontOfSize:15];
  44. //
  45. // self.uut.fontSize = @(15);
  46. // self.uut.text = @"Tab 1";
  47. //
  48. // [self.uut applyOn:viewController];
  49. //
  50. // NSDictionary* attributes = [viewController.tabBarItem titleTextAttributesForState:UIControlStateNormal];
  51. // XCTAssertTrue([attributes[@"NSFont"] isEqual:expectedFont]);
  52. //}
  53. //
  54. //- (void)test_tabBarTextFontSize_withTextFontFamily_withTextColor {
  55. // UIViewController* viewController = [UIViewController new];
  56. //
  57. // NSString* inputFont = @"HelveticaNeue";
  58. // UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
  59. //
  60. // self.uut.fontSize = @(15);
  61. // self.uut.text = @"Tab 1";
  62. // self.uut.fontFamily = inputFont;
  63. // self.uut.textColor = @(4279979127);
  64. // [self.uut applyOn:viewController];
  65. //
  66. // NSDictionary* attributes = [viewController.tabBarItem titleTextAttributesForState:UIControlStateNormal];
  67. // UIColor* color = attributes[NSForegroundColorAttributeName];
  68. // UIColor* expectedColor = [RCTConvert UIColor:@(4279979127)];
  69. //
  70. // XCTAssertTrue([color isEqual:expectedColor]);
  71. // XCTAssertTrue([attributes[@"NSFont"] isEqual:expectedFont]);
  72. //}
  73. @end