use of javax.money.convert.CurrencyConversion in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldReturnsSameEuroValue.
@Test
public void shouldReturnsSameEuroValue() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(EURO);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, EURO);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), EURO);
assertEquals(result.getNumber().numberValue(BigDecimal.class), BigDecimal.TEN);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldReturnsSameYenValue.
@Test
public void shouldReturnsSameYenValue() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(YEN);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, YEN);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), YEN);
assertEquals(result.getNumber().numberValue(BigDecimal.class), BigDecimal.TEN);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldConvertsYenToDollar.
@Test
public void shouldConvertsYenToDollar() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(DOLLAR);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, YEN);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), DOLLAR);
assertTrue(result.getNumber().doubleValue() > 0);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldConvertsDolarToEuro.
@Test
public void shouldConvertsDolarToEuro() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(EURO);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, DOLLAR);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), EURO);
assertTrue(result.getNumber().doubleValue() > 0);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldReturnsSameDollarValue.
@Test
public void shouldReturnsSameDollarValue() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(DOLLAR);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, DOLLAR);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), DOLLAR);
assertEquals(result.getNumber().numberValue(BigDecimal.class), BigDecimal.TEN);
}
Aggregations