use of org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder in project RoboBinding by RoboBinding.
the class ByBindingAttributeMappingsResolverTest method givenAnAttributeGroup_whenResolve_thenAResolvedGroupedViewAttributeShouldBeReturned.
@Test
public void givenAnAttributeGroup_whenResolve_thenAResolvedGroupedViewAttributeShouldBeReturned() {
String[] attributeGroup = { "group_attribute1", "group_attribute2" };
GroupedViewAttributeBinder viewAttributeBinder = Mockito.mock(GroupedViewAttributeBinder.class);
ByBindingAttributeMappingsResolver byBindingAttributeMappingsResolver = newByBindingAttributeMappingsResolver(aBindingAttributeMappings().withAttributeGroup(attributeGroup, viewAttributeBinder).build());
Collection<ViewAttributeBinder> viewAttributes = byBindingAttributeMappingsResolver.resolve(pendingAttributesForView);
assertThat(Sets.newHashSet(viewAttributes), equalTo(Sets.<ViewAttributeBinder>newHashSet(viewAttributeBinder)));
}
use of org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder in project RoboBinding by RoboBinding.
the class MockInitializedBindingAttributeMappingsBuilder method withAttributeGroup.
public MockInitializedBindingAttributeMappingsBuilder withAttributeGroup(String[] attributeGroup, final GroupedViewAttributeBinder viewAttributeBinder) {
attributeGroups.add(attributeGroup);
groupedViewAttributeBinderFactoryMap.put(attributeGroup, new GroupedViewAttributeBinderFactory(null, null, null) {
@Override
public GroupedViewAttributeBinder create(Object view, Map<String, String> presentAttributeMappings) {
return viewAttributeBinder;
}
});
return this;
}
Aggregations