@Test public void resultIsUsd() { convertedAmmount = converter.convert(BigDecimal.TEN, "EUR", "CAN"); Assertions.assertEquals(new BigDecimal("100"), convertedAmmount); }
public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) { BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo); return amount.multiply(exchangeRate); }
CurrencyConverter { public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) { BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo); return amount.multiply(exchangeRate); } }
CurrencyConverter { public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) { BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo); return amount.multiply(exchangeRate); } CurrencyConverter(CurrencyDto currencyDto); }
CurrencyConverter { public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) { BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo); return amount.multiply(exchangeRate); } CurrencyConverter(CurrencyDto currencyDto); static CurrencyConverter get(); BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo); }
CurrencyConverter { public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) { BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo); return amount.multiply(exchangeRate); } CurrencyConverter(CurrencyDto currencyDto); static CurrencyConverter get(); BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo);  }