Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Created March 22, 2020 07:05
Show Gist options
  • Save ashkrit/b4bec444d28e3d760a6e39339149435d to your computer and use it in GitHub Desktop.
Save ashkrit/b4bec444d28e3d760a6e39339149435d to your computer and use it in GitHub Desktop.
@Test
public void transfer_sgd_to_inr() {
FXService fxService = new FXService(currencyConverter, bankService, 0.0d);
BankAccount account = new BankAccount("1111-22222", "SuperStableBank");
expect(currencyConverter.convert(1, "SGD", "INR")).andReturn(50d);
expect(bankService.deposit(100d, account)).andReturn("99999");
replay(currencyConverter, bankService);
String id = fxService.transfer(new Money(SGD, 2d), account, INR);
assertEquals("99999", id);
verify(currencyConverter, bankService);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment