-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathTitleBarReactViewControllerTest.java
More file actions
45 lines (36 loc) · 1.45 KB
/
TitleBarReactViewControllerTest.java
File metadata and controls
45 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.reactnativenavigation.viewcontrollers.stack;
import android.app.Activity;
import com.reactnativenavigation.BaseTest;
import com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock;
import com.reactnativenavigation.options.ComponentOptions;
import com.reactnativenavigation.options.params.Text;
import com.reactnativenavigation.viewcontrollers.stack.topbar.title.TitleBarReactViewController;
import org.junit.Ignore;
import org.junit.Test;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
public class TitleBarReactViewControllerTest extends BaseTest {
private TitleBarReactViewController uut;
private TitleBarReactViewCreatorMock viewCreator;
private Activity activity;
private ComponentOptions component;
@Override
public void beforeEach() {
super.beforeEach();
viewCreator = spy(new TitleBarReactViewCreatorMock());
activity = newActivity();
component = createComponent();
uut = new TitleBarReactViewController(activity, viewCreator, component);
}
@Test
public void createView() {
uut.createView();
verify(viewCreator).create(activity, component.componentId.get(), component.name.get());
}
private ComponentOptions createComponent() {
ComponentOptions component = new ComponentOptions();
component.componentId = new Text("compId");
component.name = new Text("compName");
return component;
}
}