Search in sources :

Example 1 with GroupedViewAttributeBinder

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)));
}
Also used : GroupedViewAttributeBinder(org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder) ViewAttributeBinder(org.robobinding.viewattribute.ViewAttributeBinder) PropertyViewAttributeBinder(org.robobinding.viewattribute.property.PropertyViewAttributeBinder) MultiTypePropertyViewAttributeBinder(org.robobinding.viewattribute.property.MultiTypePropertyViewAttributeBinder) GroupedViewAttributeBinder(org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder) Test(org.junit.Test)

Example 2 with GroupedViewAttributeBinder

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;
}
Also used : GroupedViewAttributeBinder(org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder) GroupedViewAttributeBinderFactory(org.robobinding.viewattribute.grouped.GroupedViewAttributeBinderFactory)

Aggregations

GroupedViewAttributeBinder (org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder)2 Test (org.junit.Test)1 ViewAttributeBinder (org.robobinding.viewattribute.ViewAttributeBinder)1 EventViewAttributeBinder (org.robobinding.viewattribute.event.EventViewAttributeBinder)1 GroupedViewAttributeBinderFactory (org.robobinding.viewattribute.grouped.GroupedViewAttributeBinderFactory)1 MultiTypePropertyViewAttributeBinder (org.robobinding.viewattribute.property.MultiTypePropertyViewAttributeBinder)1 PropertyViewAttributeBinder (org.robobinding.viewattribute.property.PropertyViewAttributeBinder)1