Search in sources :

Example 1 with ViewResolutionErrorsException

use of org.robobinding.ViewResolutionErrorsException in project RoboBinding by RoboBinding.

the class ResolutionTest method givenASingleView_whenResolvingMissingGroupBindingAttributes_thenThrowExceptionReferencingView.

@Test
public void givenASingleView_whenResolvingMissingGroupBindingAttributes_thenThrowExceptionReferencingView() {
    PendingAttributesForView pendingAttributesForAdapterView = aPendingAttributesForAdapterView().withAttribute("source", "{names}").build();
    try {
        resolveBindingAttributes(pendingAttributesForAdapterView);
        fail("Expected exception to be thrown");
    } catch (ViewResolutionErrorsException e) {
        assertThat(e.getView(), equalTo(pendingAttributesForAdapterView.getView()));
        assertThat(e.getMissingRequiredAttributeErrors().size(), is(1));
    }
}
Also used : PendingAttributesForViewBuilder.aPendingAttributesForView(org.robobinding.binder.PendingAttributesForViewBuilder.aPendingAttributesForView) PendingAttributesForView(org.robobinding.PendingAttributesForView) ViewResolutionErrorsException(org.robobinding.ViewResolutionErrorsException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PendingAttributesForView (org.robobinding.PendingAttributesForView)1 ViewResolutionErrorsException (org.robobinding.ViewResolutionErrorsException)1 PendingAttributesForViewBuilder.aPendingAttributesForView (org.robobinding.binder.PendingAttributesForViewBuilder.aPendingAttributesForView)1