use of org.robobinding.presentationmodel.PresentationModelAdapter in project RoboBinding by RoboBinding.
the class BindingContextTest method shouldItemBindingContextWithExpectedPreInitializeViews.
@Test
public void shouldItemBindingContextWithExpectedPreInitializeViews() {
boolean expectedPreInitializeViews = RandomValues.trueOrFalse();
String propertyName = "pName";
DataSetValueModel dataSetProperty = mock(DataSetValueModel.class);
when(dataSetProperty.preInitializingViewsWithDefault(anyBoolean())).thenReturn(expectedPreInitializeViews);
PresentationModelAdapter presentationModelAdapter = aPresentationModelAdapterWithDataSetProperty(propertyName, dataSetProperty);
BindingContext context = newBindingContext(presentationModelAdapter);
ItemBindingContext itemBindingContext = context.navigateToItemContext(propertyName);
assertThat(itemBindingContext.shouldPreInitializeViews(), is(expectedPreInitializeViews));
}
use of org.robobinding.presentationmodel.PresentationModelAdapter in project RoboBinding by RoboBinding.
the class PresentationModelTester method spyPropertyChange.
public static PresentationModelPropertyChangeSpy spyPropertyChange(Object presentationModel, String propertyName) {
Preconditions.checkNotNull(presentationModel, "presentationModel must not be null");
checkNotBlank(propertyName, "propertyName must not be empty");
PresentationModelAdapter presentationModelAdapter = new PresentationModelAdapterFactory().create(new JavaReflectionPresentationModelObject(presentationModel));
PresentationModelTester presentationModelTester = new PresentationModelTester(presentationModelAdapter);
return presentationModelTester.spyPropertyChange(propertyName);
}
Aggregations