Search in sources :

Example 6 with ValueContext

use of com.vaadin.data.ValueContext in project cia by Hack23.

the class ListPropertyConverterTest method convertToModelVerifyDummyImplTest.

/**
 * Convert to model verify dummy impl test.
 */
@Test
public void convertToModelVerifyDummyImplTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final Result<List<?>> convertToModel = new ListPropertyConverter("", null).convertToModel("value", context);
    assertNotNull(convertToModel);
    assertFalse(convertToModel.isError());
}
Also used : ValueContext(com.vaadin.data.ValueContext) List(java.util.List) AbstractUnitTest(com.hack23.cia.testfoundation.AbstractUnitTest) Test(org.junit.Test)

Example 7 with ValueContext

use of com.vaadin.data.ValueContext in project cia by Hack23.

the class ListPropertyConverterTest method convertToPresentationTest.

/**
 * Convert to presentation test.
 */
@Test
public void convertToPresentationTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final String emptyString = new ListPropertyConverter("partyId", "partyId").convertToPresentation(Arrays.asList(new ViewRiksdagenParty().withPartyId("partyId")), context);
    assertEquals("[partyId ]", emptyString);
}
Also used : ValueContext(com.vaadin.data.ValueContext) ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) AbstractUnitTest(com.hack23.cia.testfoundation.AbstractUnitTest) Test(org.junit.Test)

Aggregations

AbstractUnitTest (com.hack23.cia.testfoundation.AbstractUnitTest)7 ValueContext (com.vaadin.data.ValueContext)7 Test (org.junit.Test)7 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)4 ViewRiksdagenCommittee (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)1 List (java.util.List)1