Search in sources :

Example 1 with AmountFormatQuery

use of javax.money.format.AmountFormatQuery in project jsr354-ri-bp by JavaMoney.

the class MonetaryFormatsTest method testFormat_EUR_fr_FR.

@Test
@Ignore
public void testFormat_EUR_fr_FR() {
    AmountFormatQuery formatQuery = AmountFormatQueryBuilder.of(FRANCE).set(CODE).build();
    MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(formatQuery);
    assertMoneyFormat(format, Money.of(123.01, "EUR"), "123,01 EUR");
    assertMoneyFormat(format, Money.of(14000.12, "EUR"), "14 000,12 EUR");
}
Also used : AmountFormatQuery(javax.money.format.AmountFormatQuery) MonetaryAmountFormat(javax.money.format.MonetaryAmountFormat) Ignore(org.testng.annotations.Ignore) Test(org.testng.annotations.Test)

Example 2 with AmountFormatQuery

use of javax.money.format.AmountFormatQuery in project jsr354-ri-bp by JavaMoney.

the class MonetaryFormatsTest method testParse_DKK_da.

@Test
public void testParse_DKK_da() {
    AmountFormatQuery formatQuery = AmountFormatQueryBuilder.of(DANISH).set(CODE).build();
    MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(formatQuery);
    // assertMoneyParse(format, "123 DKK", 123.0, "DKK");
    assertMoneyParse(format, "DKK 123,01", 123.01, "DKK");
    assertMoneyParse(format, "DKK 14.000,12", 14000.12, "DKK");
// assertMoneyParse(format, "14.000,12\u00A0DKK", 14000.12, "DKK");
}
Also used : AmountFormatQuery(javax.money.format.AmountFormatQuery) MonetaryAmountFormat(javax.money.format.MonetaryAmountFormat) Test(org.testng.annotations.Test)

Example 3 with AmountFormatQuery

use of javax.money.format.AmountFormatQuery in project jsr354-ri-bp by JavaMoney.

the class MonetaryFormatsTest method testParse_BGN_bg_BG.

@Test
public void testParse_BGN_bg_BG() {
    AmountFormatQuery formatQuery = AmountFormatQueryBuilder.of(BULGARIA).set(CODE).build();
    MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(formatQuery);
    assertMoneyParse(format, "123 BGN", 123.0, "BGN");
    assertMoneyParse(format, "123,01 BGN", 123.01, "BGN");
// assertMoneyParse(format, "14 000,12 BGN", 14000.12, "BGN");
// assertMoneyParse(format, "14\u00A0000,12\u00A0BGN", 14000.12, "BGN");
}
Also used : AmountFormatQuery(javax.money.format.AmountFormatQuery) MonetaryAmountFormat(javax.money.format.MonetaryAmountFormat) Test(org.testng.annotations.Test)

Example 4 with AmountFormatQuery

use of javax.money.format.AmountFormatQuery in project jsr354-ri by JavaMoney.

the class MonetaryFormatsTest method testFormat_EUR_fr_FR.

@Test
public void testFormat_EUR_fr_FR() {
    AmountFormatQuery formatQuery = AmountFormatQueryBuilder.of(FRANCE).set(CODE).build();
    MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(formatQuery);
    assertMoneyFormat(format, Money.of(123.01, "EUR"), "123,01 EUR");
    assertMoneyFormat(format, Money.of(14000.12, "EUR"), "14 000,12 EUR");
}
Also used : AmountFormatQuery(javax.money.format.AmountFormatQuery) MonetaryAmountFormat(javax.money.format.MonetaryAmountFormat) Test(org.testng.annotations.Test)

Example 5 with AmountFormatQuery

use of javax.money.format.AmountFormatQuery in project jsr354-ri by JavaMoney.

the class MonetaryFormatsTest method testFormat_EUR_de_DE.

@Test
public void testFormat_EUR_de_DE() {
    AmountFormatQuery formatQuery = AmountFormatQueryBuilder.of(GERMANY).set(CODE).build();
    MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(formatQuery);
    assertMoneyFormat(format, Money.of(123.01, "EUR"), "123,01 EUR");
    assertMoneyFormat(format, Money.of(14000.12, "EUR"), "14.000,12 EUR");
}
Also used : AmountFormatQuery(javax.money.format.AmountFormatQuery) MonetaryAmountFormat(javax.money.format.MonetaryAmountFormat) Test(org.testng.annotations.Test)

Aggregations

AmountFormatQuery (javax.money.format.AmountFormatQuery)24 MonetaryAmountFormat (javax.money.format.MonetaryAmountFormat)24 Test (org.testng.annotations.Test)23 MonetaryAmount (javax.money.MonetaryAmount)3 CurrencyUnit (javax.money.CurrencyUnit)1 AmountFormatQueryBuilder (javax.money.format.AmountFormatQueryBuilder)1 MonetaryParseException (javax.money.format.MonetaryParseException)1 Ignore (org.testng.annotations.Ignore)1