Skip to content

Commit

Permalink
iluwatar#1305: Amended Money Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hheanly123 committed Oct 15, 2023
1 parent 6e4cb6c commit a650644
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions money/src/test/java/MoneyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,13 @@ public void testAllocate() {
assertEquals(500, account1.getPrimaryBalance().getAmount());
assertEquals(500, account2.getPrimaryBalance().getAmount());
}

@Test(expected = IllegalArgumentException.class)
public void testAllocateInvalidPercentages() {
Account[] accounts = {account1, account2};
money1.allocate(accounts, 40, 60);
}

@Test(expected = IllegalArgumentException.class)
public void testAllocateDifferentCurrencies() {
Account account3 = new Account(usd, Currency.usd());
Account[] accounts = {account1, account3};
money1.allocate(accounts, 50, 50);
}

@Test
public void testDeposit() {
Money depositMoney = new Money(200, usd);
account1.deposit(depositMoney);
assertEquals(200, account1.getPrimaryBalance().getAmount());
}

@Test(expected = IllegalArgumentException.class)
public void testDepositInvalidCurrency() {
Money depositMoney = new Money(200, eur);
account1.deposit(depositMoney);
}

@Test
public void testWithdraw() {
Expand Down

0 comments on commit a650644

Please sign in to comment.