Search in sources :

Example 1 with Decimal

use of org.faktorips.values.Decimal in project linkki by linkki-framework.

the class FormattedDecimalFieldToStringConverterTest method testConvertToModel.

@ParameterizedTest
@MethodSource("data")
public void testConvertToModel(Decimal decimalValue, String stringValue) {
    ValueContext context = new ValueContext(Locale.GERMAN);
    assertThat(converter.convertToModel(stringValue, context).getOrThrow(s -> new AssertionError(s)), is(decimalValue));
}
Also used : ValueContext(com.vaadin.flow.data.binder.ValueContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) Test(org.junit.jupiter.api.Test) Decimal(org.faktorips.values.Decimal) Arrays(java.util.Arrays) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Locale(java.util.Locale) Collection(java.util.Collection) ValueContext(com.vaadin.flow.data.binder.ValueContext) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) MethodSource(org.junit.jupiter.params.provider.MethodSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

ValueContext (com.vaadin.flow.data.binder.ValueContext)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Locale (java.util.Locale)1 Decimal (org.faktorips.values.Decimal)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1