react-native-navigation的迁移库

UITabBarController+RNNOptionsTest.m 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #import <XCTest/XCTest.h>
  2. #import "UITabBarController+RNNOptions.h"
  3. @interface UITabBarController_RNNOptionsTest : XCTestCase
  4. @property (nonatomic, retain) UITabBarController* uut;
  5. @end
  6. @implementation UITabBarController_RNNOptionsTest
  7. - (void)setUp {
  8. [super setUp];
  9. self.uut = [UITabBarController new];
  10. }
  11. - (void)test_tabBarTranslucent_true {
  12. [self.uut rnn_setTabBarTranslucent:YES];
  13. XCTAssertTrue(self.uut.tabBar.translucent);
  14. }
  15. - (void)test_tabBarTranslucent_false {
  16. [self.uut rnn_setTabBarTranslucent:NO];
  17. XCTAssertFalse(self.uut.tabBar.translucent);
  18. }
  19. - (void)test_tabBarHideShadow_default {
  20. XCTAssertFalse(self.uut.tabBar.clipsToBounds);
  21. }
  22. - (void)test_tabBarHideShadow_true {
  23. [self.uut rnn_setTabBarHideShadow:YES];
  24. XCTAssertTrue(self.uut.tabBar.clipsToBounds);
  25. }
  26. - (void)test_tabBarHideShadow_false {
  27. [self.uut rnn_setTabBarHideShadow:NO];
  28. XCTAssertFalse(self.uut.tabBar.clipsToBounds);
  29. }
  30. - (void)test_tabBarBackgroundColor {
  31. UIColor* tabBarBackgroundColor = [UIColor redColor];
  32. [self.uut rnn_setTabBarBackgroundColor:tabBarBackgroundColor];
  33. XCTAssertTrue([self.uut.tabBar.barTintColor isEqual:tabBarBackgroundColor]);
  34. }
  35. @end