use of org.robobinding.test.JavaReflectionPresentationModelObject in project RoboBinding by RoboBinding.
the class BindingTest method newBindingContext.
@SuppressWarnings("unchecked")
private BindingContext newBindingContext() {
BinderProvider binderProvider = mock(BinderProvider.class);
BindableView bindableView = mock(BindableView.class);
when(bindableView.getRootView()).then(new Answer<View>() {
@Override
public View answer(InvocationOnMock invocation) throws Throwable {
return new View(context);
}
});
ItemBinder itemBinder = mock(ItemBinder.class);
when(itemBinder.inflateWithoutAttachingToRoot(anyInt(), anyCollection(), any(ViewGroup.class))).thenReturn(bindableView);
when(binderProvider.createItemBinder(any(BindingContextFactory.class))).thenReturn(itemBinder);
return new BindingContext(binderProvider, context, new PresentationModelAdapterFactory().create(new JavaReflectionPresentationModelObject(new PresentationModelForTest())), PreInitializingViews.initial(true));
}
Aggregations