use of org.javamoney.moneta.convert.ExchangeRateMonetarySummaryStatistics in project jsr354-ri-bp by JavaMoney.
the class ExchangeRateMonetarySummaryStatisticsTest method createSummary.
private MonetarySummaryStatistics createSummary(CurrencyUnit currencyUnit) {
MonetarySummaryStatistics summary = new ExchangeRateMonetarySummaryStatistics(currencyUnit, provider);
summary.accept(Money.of(10, currencyUnit));
summary.accept(Money.of(90, currencyUnit));
summary.accept(Money.of(110, currencyUnit));
return summary;
}
use of org.javamoney.moneta.convert.ExchangeRateMonetarySummaryStatistics in project jsr354-ri-bp by JavaMoney.
the class ExchangeRateMonetarySummaryStatisticsTest method shouldConvertWhenIsDifferentCurrency.
@Test
public void shouldConvertWhenIsDifferentCurrency() {
MonetarySummaryStatistics summary = new ExchangeRateMonetarySummaryStatistics(BRAZILIAN_REAL, provider);
summary.accept(Money.of(10, DOLLAR));
assertEquals(BRAZILIAN_REAL, summary.getCurrencyUnit());
assertEquals(1L, summary.getCount());
assertNotSame(0L, summary.getMin().getNumber().longValue());
assertNotSame(0L, summary.getMax().getNumber().longValue());
assertNotSame(0L, summary.getSum().getNumber().longValue());
assertNotSame(0L, summary.getAverage().getNumber().longValue());
}
Aggregations