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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations