use of javax.money.convert.CurrencyConversion in project jsr354-ri by JavaMoney.
the class IMFRateProviderTest method shouldReturnsSameBrazilianValue.
@Test
public void shouldReturnsSameBrazilianValue() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(BRAZILIAN_REAL);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), BRAZILIAN_REAL);
assertEquals(result.getNumber().numberValue(BigDecimal.class), BigDecimal.TEN);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri by JavaMoney.
the class IMFRateProviderTest method shouldConvertsBrazilianToDollar.
@Test
public void shouldConvertsBrazilianToDollar() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(DOLLAR);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), DOLLAR);
assertTrue(result.getNumber().doubleValue() > 0);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri by JavaMoney.
the class IMFRateProviderTest 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 by JavaMoney.
the class IMFRateProviderTest method shouldConvertsDollarToBrazilian.
@Test
public void shouldConvertsDollarToBrazilian() {
CurrencyConversion currencyConversion = provider.getCurrencyConversion(BRAZILIAN_REAL);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, DOLLAR);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), BRAZILIAN_REAL);
assertTrue(result.getNumber().doubleValue() > 0);
}
use of javax.money.convert.CurrencyConversion in project jsr354-ri by JavaMoney.
the class IMFRateProviderTest method shouldConvertsDollarToEuro.
@Test
public void shouldConvertsDollarToEuro() {
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);
}
Aggregations