react-native-navigation的迁移库

UITabBarController+RNNOptionsTest.m 1.2KB

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