@Test public void testDeposits() { DollarAmount someAmount = randomDollarAmount(); batman.deposit(someAmount); assertEquals(batman.currentBalance(), batmanInitialBalance.add(someAmount)); DollarAmount anotherAmount = randomDollarAmount(); batman.deposit(anotherAmount); assertEquals(batman.currentBalance(), batmanInitialBalance.add(someAmount).add(anotherAmount)); }
@Test public void testWithdrawals() { DollarAmount someAmount = randomDollarAmount(); robin.withdrawal(someAmount); assertEquals(robin.currentBalance(), robinInitialBalance.subtract(someAmount)); DollarAmount anotherAmount = randomDollarAmount(); robin.withdrawal(anotherAmount); assertEquals( robin.currentBalance(), robinInitialBalance.subtract(someAmount).subtract(anotherAmount)); }
@Test public void testTransfers() { DollarAmount someAmount = randomDollarAmount(); batman.transferTo(robin, someAmount); assertEquals(batman.currentBalance(), batmanInitialBalance.subtract(someAmount)); assertEquals(robin.currentBalance(), robinInitialBalance.add(someAmount)); DollarAmount anotherAmount = randomDollarAmount(); robin.transferTo(batman, anotherAmount); assertEquals( batman.currentBalance(), batmanInitialBalance.subtract(someAmount).add(anotherAmount)); assertEquals( robin.currentBalance(), robinInitialBalance.add(someAmount).subtract(anotherAmount)); }