react-native-navigation的迁移库

UITabBarController+RNNOptionsTest.m 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #import <XCTest/XCTest.h>
  2. #import <OCMock/OCMock.h>
  3. #import "UITabBarController+RNNOptions.h"
  4. #import "UITabBar+utils.h"
  5. @interface UITabBarController_RNNOptionsTest : XCTestCase
  6. @property (nonatomic, retain) UITabBarController* uut;
  7. @end
  8. @implementation UITabBarController_RNNOptionsTest
  9. - (void)setUp {
  10. [super setUp];
  11. self.uut = [OCMockObject partialMockForObject:[UITabBarController new]];
  12. OCMStub([self.uut tabBar]).andReturn([OCMockObject partialMockForObject:[UITabBar new]]);
  13. }
  14. - (void)test_centerTabItems {
  15. [[(id)self.uut.tabBar expect] centerTabItems];
  16. [self.uut centerTabItems];
  17. [(id)self.uut.tabBar verify];
  18. }
  19. - (void)test_tabBarTranslucent_true {
  20. [self.uut setTabBarTranslucent:YES];
  21. XCTAssertTrue(self.uut.tabBar.translucent);
  22. }
  23. - (void)test_tabBarTranslucent_false {
  24. [self.uut setTabBarTranslucent:NO];
  25. XCTAssertFalse(self.uut.tabBar.translucent);
  26. }
  27. - (void)test_tabBarHideShadow_default {
  28. XCTAssertFalse(self.uut.tabBar.clipsToBounds);
  29. }
  30. - (void)test_tabBarHideShadow_true {
  31. [self.uut setTabBarHideShadow:YES];
  32. XCTAssertTrue(self.uut.tabBar.clipsToBounds);
  33. }
  34. - (void)test_tabBarHideShadow_false {
  35. [self.uut setTabBarHideShadow:NO];
  36. XCTAssertFalse(self.uut.tabBar.clipsToBounds);
  37. }
  38. @end