|
@@ -72,4 +72,19 @@ public class NavigationControllerTest extends BaseTest {
|
72
|
72
|
NavigationController anotherNavController = new NavigationController(child2);
|
73
|
73
|
assertThat(child2.getNavigationController()).isEqualTo(anotherNavController);
|
74
|
74
|
}
|
|
75
|
+
|
|
76
|
+ @Test
|
|
77
|
+ public void handleBack_PopsUnlessSingleChild() throws Exception {
|
|
78
|
+ assertThat(uut.isEmpty()).isTrue();
|
|
79
|
+ assertThat(uut.handleBack()).isFalse();
|
|
80
|
+
|
|
81
|
+ uut.push(child1);
|
|
82
|
+ assertThat(uut.size()).isEqualTo(1);
|
|
83
|
+ assertThat(uut.handleBack()).isFalse();
|
|
84
|
+
|
|
85
|
+ uut.push(child2);
|
|
86
|
+ assertThat(uut.size()).isEqualTo(2);
|
|
87
|
+ assertThat(uut.handleBack()).isTrue();
|
|
88
|
+ assertThat(uut.size()).isEqualTo(1);
|
|
89
|
+ }
|
75
|
90
|
}
|