|
@@ -100,34 +100,35 @@
|
100
|
100
|
|
101
|
101
|
|
102
|
102
|
- (void)testCreateLayout_ContainerSideMenuLayoutCenterLeftRight {
|
103
|
|
- RNNSideMenuController *ans = (RNNSideMenuController*) [self.factory createLayout:@{@"id": @"cntId",
|
104
|
|
- @"type": @"SideMenuRoot",
|
105
|
|
- @"data": @{},
|
106
|
|
- @"children": @[
|
107
|
|
- @{@"id": @"cntI_2",
|
108
|
|
- @"type": @"SideMenuCenter",
|
109
|
|
- @"data": @{},
|
110
|
|
- @"children": @[
|
111
|
|
- @{@"id": @"cntId_3",
|
112
|
|
- @"type": @"Container",
|
113
|
|
- @"data": @{},
|
114
|
|
- @"children": @[]}]},
|
115
|
|
- @{@"id": @"cntI_4",
|
116
|
|
- @"type": @"SideMenuLeft",
|
117
|
|
- @"data": @{},
|
118
|
|
- @"children": @[
|
119
|
|
- @{@"id": @"cntId_5",
|
120
|
|
- @"type": @"Container",
|
121
|
|
- @"data": @{},
|
122
|
|
- @"children": @[]}]},
|
123
|
|
- @{@"id": @"cntI_6",
|
124
|
|
- @"type": @"SideMenuRight",
|
125
|
|
- @"data": @{},
|
126
|
|
- @"children": @[
|
127
|
|
- @{@"id": @"cntId_5",
|
128
|
|
- @"type": @"Container",
|
129
|
|
- @"data": @{},
|
130
|
|
- @"children": @[]}]}]}];
|
|
103
|
+ RNNSideMenuController *ans = (RNNSideMenuController*) [self.factory createLayout:
|
|
104
|
+ @{@"id": @"cntId",
|
|
105
|
+ @"type": @"SideMenuRoot",
|
|
106
|
+ @"data": @{},
|
|
107
|
+ @"children": @[
|
|
108
|
+ @{@"id": @"cntI_2",
|
|
109
|
+ @"type": @"SideMenuCenter",
|
|
110
|
+ @"data": @{},
|
|
111
|
+ @"children": @[
|
|
112
|
+ @{@"id": @"cntId_3",
|
|
113
|
+ @"type": @"Container",
|
|
114
|
+ @"data": @{},
|
|
115
|
+ @"children": @[]}]},
|
|
116
|
+ @{@"id": @"cntI_4",
|
|
117
|
+ @"type": @"SideMenuLeft",
|
|
118
|
+ @"data": @{},
|
|
119
|
+ @"children": @[
|
|
120
|
+ @{@"id": @"cntId_5",
|
|
121
|
+ @"type": @"Container",
|
|
122
|
+ @"data": @{},
|
|
123
|
+ @"children": @[]}]},
|
|
124
|
+ @{@"id": @"cntI_6",
|
|
125
|
+ @"type": @"SideMenuRight",
|
|
126
|
+ @"data": @{},
|
|
127
|
+ @"children": @[
|
|
128
|
+ @{@"id": @"cntId_5",
|
|
129
|
+ @"type": @"Container",
|
|
130
|
+ @"data": @{},
|
|
131
|
+ @"children": @[]}]}]}];
|
131
|
132
|
XCTAssertTrue([ans isMemberOfClass:[RNNSideMenuController class]]);
|
132
|
133
|
XCTAssertTrue([ans isKindOfClass:[UIViewController class]]);
|
133
|
134
|
XCTAssertTrue([ans.center isMemberOfClass:[RNNSideMenuChildVC class]]);
|
|
@@ -144,6 +145,50 @@
|
144
|
145
|
XCTAssertTrue([right.child isMemberOfClass:[RNNRootViewController class]]);
|
145
|
146
|
}
|
146
|
147
|
|
|
148
|
+- (void)testCreateLayout_ContainerSideMenuLayoutCenterTabBar {
|
|
149
|
+ RNNSideMenuController *ans = (RNNSideMenuController*) [self.factory createLayout:
|
|
150
|
+ @{@"id": @"cntId",
|
|
151
|
+ @"type": @"SideMenuRoot",
|
|
152
|
+ @"data": @{},
|
|
153
|
+ @"children": @[
|
|
154
|
+ @{@"id": @"cntI_2",
|
|
155
|
+ @"type": @"SideMenuCenter",
|
|
156
|
+ @"data": @{},
|
|
157
|
+ @"children": @[
|
|
158
|
+ @{@"id": @"cntId_3",
|
|
159
|
+ @"type": @"BottomTabs",
|
|
160
|
+ @"data": @{},
|
|
161
|
+ @"children": @[
|
|
162
|
+ @{@"id": @"cntId_4",
|
|
163
|
+ @"type": @"ContainerStack",
|
|
164
|
+ @"data": @{},
|
|
165
|
+ @"children": @[
|
|
166
|
+ @{@"id": @"cntId_2",
|
|
167
|
+ @"type": @"Container",
|
|
168
|
+ @"data": @{},
|
|
169
|
+ @"children": @[]}]}]}]}]}
|
|
170
|
+ ];
|
|
171
|
+
|
|
172
|
+ XCTAssertTrue([ans isMemberOfClass:[RNNSideMenuController class]]);
|
|
173
|
+ XCTAssertTrue([ans isKindOfClass:[UIViewController class]]);
|
|
174
|
+ XCTAssertTrue([ans.center isMemberOfClass:[RNNSideMenuChildVC class]]);
|
|
175
|
+
|
|
176
|
+ RNNSideMenuChildVC *center = (RNNSideMenuChildVC*)ans.center;
|
|
177
|
+ XCTAssertTrue(center.type == RNNSideMenuChildTypeCenter);
|
|
178
|
+ XCTAssertTrue([center.child isMemberOfClass:[UITabBarController class]]);
|
|
179
|
+
|
|
180
|
+ UITabBarController *tabbBar = (UITabBarController*)center.child;
|
|
181
|
+ XCTAssertTrue(tabbBar.viewControllers.count == 1);
|
|
182
|
+
|
|
183
|
+ UINavigationController *navController = (UINavigationController*)(tabbBar.viewControllers[0]);
|
|
184
|
+ XCTAssertTrue([navController isMemberOfClass:[UINavigationController class]]);
|
|
185
|
+ XCTAssertTrue(navController.viewControllers.count == 1);
|
|
186
|
+
|
|
187
|
+ RNNRootViewController *rootViewController = (RNNRootViewController*)navController.viewControllers[0];
|
|
188
|
+ XCTAssertTrue([rootViewController isMemberOfClass:[RNNRootViewController class]]);
|
|
189
|
+
|
|
190
|
+}
|
|
191
|
+
|
147
|
192
|
|
148
|
193
|
|
149
|
194
|
@end
|