use of org.robobinding.property.DataSetValueModel in project RoboBinding by RoboBinding.
the class BindingContext method navigateToItemContext.
public ItemBindingContext navigateToItemContext(String propertyName) {
DataSetValueModel valueModel = presentationModelAdapter.getDataSetPropertyValueModel(propertyName);
boolean itemPreInitializeViews = valueModel.preInitializingViewsWithDefault(preInitializeViews.defaultValue);
return new ItemBindingContext(new ItemBinderFactory(binderProvider, createBindingContextFactory(preInitializeViews.withValue(itemPreInitializeViews))), valueModel, itemPreInitializeViews);
}
use of org.robobinding.property.DataSetValueModel 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));
}
Aggregations