|
@@ -1,5 +1,7 @@
|
1
|
1
|
#import <XCTest/XCTest.h>
|
2
|
2
|
#import "RNNBottomTabPresenter.h"
|
|
3
|
+#import <OCMock/OCMock.h>
|
|
4
|
+#import "UIViewController+RNNOptions.h"
|
3
|
5
|
|
4
|
6
|
@interface RNNBottomTabPresenterTest : XCTestCase
|
5
|
7
|
|
|
@@ -13,6 +15,32 @@
|
13
|
15
|
|
14
|
16
|
- (void)setUp {
|
15
|
17
|
[super setUp];
|
|
18
|
+ self.uut = [[RNNBottomTabPresenter alloc] init];
|
|
19
|
+ self.bindedViewController = [OCMockObject partialMockForObject:[UIViewController new]];
|
|
20
|
+ [self.uut bindViewController:self.bindedViewController];
|
|
21
|
+ self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
|
22
|
+}
|
|
23
|
+
|
|
24
|
+- (void)testApplyOptions_shouldSetTabBarItemBadgeWithDefault {
|
|
25
|
+ [[self.bindedViewController expect] rnn_setTabBarItemBadge:nil];
|
|
26
|
+ [self.uut applyOptions:self.options];
|
|
27
|
+ [self.bindedViewController verify];
|
|
28
|
+}
|
|
29
|
+
|
|
30
|
+- (void)testApplyOptions_shouldSetTabBarItemBadgeWithValue {
|
|
31
|
+ self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
|
|
32
|
+ [[self.bindedViewController expect] rnn_setTabBarItemBadge:@"badge"];
|
|
33
|
+ [self.uut applyOptions:self.options];
|
|
34
|
+ [self.bindedViewController verify];
|
|
35
|
+}
|
|
36
|
+
|
|
37
|
+- (void)testApplyOptions_setTabBarItemBadgeShouldNotCalledOnUITabBarController {
|
|
38
|
+ self.bindedViewController = [OCMockObject partialMockForObject:[UITabBarController new]];
|
|
39
|
+ [self.uut bindViewController:self.bindedViewController];
|
|
40
|
+ self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
|
|
41
|
+ [[self.bindedViewController reject] rnn_setTabBarItemBadge:@"badge"];
|
|
42
|
+ [self.uut applyOptions:self.options];
|
|
43
|
+ [self.bindedViewController verify];
|
16
|
44
|
}
|
17
|
45
|
|
18
|
46
|
//- (void)test_tabBarTextFontFamily_validFont {
|