use of org.javamoney.moneta.Money in project tutorials by eugenp.
the class JavaMoneyUnitManualTest method givenCurrencies_whenCompared_thanNotequal.
@Test
public void givenCurrencies_whenCompared_thanNotequal() {
MonetaryAmount oneDolar = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(1).create();
Money oneEuro = Money.of(1, "EUR");
assertFalse(oneEuro.equals(FastMoney.of(1, "EUR")));
assertTrue(oneDolar.equals(Money.of(1, "USD")));
}
Aggregations