public void Transfer_WithInadequateBalance_ThrowsArgumentException_MakesNoChanges() { var source = new BankAccount(); source.Deposit(25.0); var destination = new BankAccount(); destination.Deposit(100.0); Assert.Throws<ApplicationException>(() => source.TransferFunds(destination, 50.0)); Assert.That(source.Balance, Is.EqualTo(25.0)); Assert.That(destination.Balance, Is.EqualTo(100.0)); }
public void TransferFunds() { BankAccount source = new BankAccount(); source.Deposit(200.00); BankAccount destination = new BankAccount(); destination.Deposit(150.00); source.TransferFunds(destination, 100.00); Assert.AreEqual(250.00, destination.Balance); Assert.AreEqual(100.00, source.Balance); }