Search in sources :

Example 1 with FastMoneyProducer

use of org.javamoney.moneta.function.FastMoneyProducer in project jsr354-ri by JavaMoney.

the class MonetaryAmountDecimalFormatBuilderTest method shouldCreateSettingCurrencyUnit.

@Test
public void shouldCreateSettingCurrencyUnit() {
    CurrencyUnit currencyUnit = Monetary.getCurrency("BRL");
    MonetaryAmountDecimalFormat format = (MonetaryAmountDecimalFormat) MonetaryAmountDecimalFormatBuilder.newInstance().withProducer(new FastMoneyProducer()).withCurrencyUnit(currencyUnit).build();
    assertEquals(format.getCurrencyUnit(), currencyUnit);
    assertEquals(format.getProducer().getClass(), FastMoneyProducer.class);
    assertEquals(format.getDecimalFormat().getCurrency().getCurrencyCode(), format.getCurrencyUnit().getCurrencyCode());
}
Also used : CurrencyUnit(javax.money.CurrencyUnit) FastMoneyProducer(org.javamoney.moneta.function.FastMoneyProducer) Test(org.testng.annotations.Test)

Example 2 with FastMoneyProducer

use of org.javamoney.moneta.function.FastMoneyProducer in project jsr354-ri-bp by JavaMoney.

the class MonetaryAmountDecimalFormatBuilderTest method shouldCreateSettingProducer.

@Test
public void shouldCreateSettingProducer() {
    MonetaryAmountDecimalFormat format = (MonetaryAmountDecimalFormat) MonetaryAmountDecimalFormatBuilder.newInstance().withProducer(new FastMoneyProducer()).build();
    assertEquals(format.getCurrencyUnit(), Monetary.getCurrency(Locale.getDefault()));
    assertEquals(format.getProducer().getClass(), FastMoneyProducer.class);
    assertEquals(format.getDecimalFormat().getCurrency().getCurrencyCode(), format.getCurrencyUnit().getCurrencyCode());
}
Also used : FastMoneyProducer(org.javamoney.moneta.function.FastMoneyProducer) Test(org.testng.annotations.Test)

Example 3 with FastMoneyProducer

use of org.javamoney.moneta.function.FastMoneyProducer in project jsr354-ri-bp by JavaMoney.

the class FastMoneyProducerTest method setup.

@BeforeMethod
public void setup() {
    producer = new FastMoneyProducer();
    currency = Monetary.getCurrency(Locale.getDefault());
}
Also used : FastMoneyProducer(org.javamoney.moneta.function.FastMoneyProducer) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with FastMoneyProducer

use of org.javamoney.moneta.function.FastMoneyProducer in project jsr354-ri by JavaMoney.

the class MonetaryAmountDecimalFormatBuilderTest method shouldCreateSettingProducer.

@Test
public void shouldCreateSettingProducer() {
    MonetaryAmountDecimalFormat format = (MonetaryAmountDecimalFormat) MonetaryAmountDecimalFormatBuilder.newInstance().withProducer(new FastMoneyProducer()).build();
    assertEquals(format.getCurrencyUnit(), Monetary.getCurrency(Locale.getDefault()));
    assertEquals(format.getProducer().getClass(), FastMoneyProducer.class);
    assertEquals(format.getDecimalFormat().getCurrency().getCurrencyCode(), format.getCurrencyUnit().getCurrencyCode());
}
Also used : FastMoneyProducer(org.javamoney.moneta.function.FastMoneyProducer) Test(org.testng.annotations.Test)

Example 5 with FastMoneyProducer

use of org.javamoney.moneta.function.FastMoneyProducer in project jsr354-ri by JavaMoney.

the class FastMoneyProducerTest method setup.

@BeforeMethod
public void setup() {
    producer = new FastMoneyProducer();
    currency = Monetary.getCurrency(Locale.getDefault());
}
Also used : FastMoneyProducer(org.javamoney.moneta.function.FastMoneyProducer) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FastMoneyProducer (org.javamoney.moneta.function.FastMoneyProducer)6 Test (org.testng.annotations.Test)4 CurrencyUnit (javax.money.CurrencyUnit)2 BeforeMethod (org.testng.annotations.BeforeMethod)2