|
@@ -21,12 +21,18 @@ public class ChildControllerTest extends BaseTest {
|
21
|
21
|
private ChildController uut;
|
22
|
22
|
private ChildControllersRegistry childRegistry;
|
23
|
23
|
private OptionsPresenter presenter;
|
|
24
|
+ private Options resolvedOptions = new Options();
|
24
|
25
|
|
25
|
26
|
@Override
|
26
|
27
|
public void beforeEach() {
|
27
|
28
|
childRegistry = spy(new ChildControllersRegistry());
|
28
|
29
|
presenter = Mockito.mock(OptionsPresenter.class);
|
29
|
|
- uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options());
|
|
30
|
+ uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options()) {
|
|
31
|
+ @Override
|
|
32
|
+ public Options resolveCurrentOptions() {
|
|
33
|
+ return resolvedOptions;
|
|
34
|
+ }
|
|
35
|
+ };
|
30
|
36
|
}
|
31
|
37
|
|
32
|
38
|
@Test
|
|
@@ -45,10 +51,9 @@ public class ChildControllerTest extends BaseTest {
|
45
|
51
|
|
46
|
52
|
@Test
|
47
|
53
|
public void applyOptions_applyRootOptionsIfRoot() {
|
48
|
|
- addToParent(newActivity(), uut);
|
49
|
|
- Options options = new Options();
|
50
|
|
- uut.applyOptions(options);
|
51
|
|
- verify(presenter, times(1)).applyRootOptions(uut.getView(), options);
|
|
54
|
+ newActivity().setContentView(uut.getView());
|
|
55
|
+ verify(presenter).applyOptions(uut.getView(), resolvedOptions);
|
|
56
|
+ verify(presenter).applyRootOptions(uut.getView(), resolvedOptions);
|
52
|
57
|
}
|
53
|
58
|
|
54
|
59
|
@Test
|
|
@@ -61,6 +66,8 @@ public class ChildControllerTest extends BaseTest {
|
61
|
66
|
|
62
|
67
|
@Test
|
63
|
68
|
public void mergeOptions() {
|
|
69
|
+ newActivity().setContentView(uut.getView());
|
|
70
|
+
|
64
|
71
|
Options options = new Options();
|
65
|
72
|
uut.mergeOptions(options);
|
66
|
73
|
verify(presenter).mergeOptions(uut.getView(), options);
|