Search in sources :

Example 1 with ValueContext

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

the class ListPropertyConverterTest method convertToPresentationNoValueTest.

/**
 * Convert to presentation no value test.
 */
@Test
public void convertToPresentationNoValueTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final String emptyString = new ListPropertyConverter("partyId", "partyId").convertToPresentation(Arrays.asList(new ViewRiksdagenParty()), context);
    assertEquals("[ ]", 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)

Example 2 with ValueContext

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

the class ListPropertyConverterTest method convertToPresentationNullValueFailureTest.

/**
 * Convert to presentation null value failure test.
 */
@Test
public void convertToPresentationNullValueFailureTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final String emptyString = new ListPropertyConverter("", null).convertToPresentation(null, context);
    assertEquals("", emptyString);
}
Also used : ValueContext(com.vaadin.data.ValueContext) AbstractUnitTest(com.hack23.cia.testfoundation.AbstractUnitTest) Test(org.junit.Test)

Example 3 with ValueContext

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

the class ListPropertyConverterTest method convertToPresentationFallbackTest.

/**
 * Convert to presentation fallback test.
 */
@Test
public void convertToPresentationFallbackTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final String emptyString = new ListPropertyConverter("partyId", "partyId", "partyName").convertToPresentation(Arrays.asList(new ViewRiksdagenParty().withPartyName("PartyName")), context);
    assertEquals("[PartyName ]", 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)

Example 4 with ValueContext

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

the class ListPropertyConverterTest method convertToPresentationWrongPathMethodValueFailureTest.

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

Example 5 with ValueContext

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

the class ListPropertyConverterTest method convertToPresentationFallbackNoValueTest.

/**
 * Convert to presentation fallback no value test.
 */
@Test
public void convertToPresentationFallbackNoValueTest() {
    final ValueContext context = new ValueContext(Locale.ENGLISH);
    final String emptyString = new ListPropertyConverter("partyId", "partyId", "partyName").convertToPresentation(Arrays.asList(new ViewRiksdagenParty()), context);
    assertEquals("[ ]", 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