public void CaseThree() { // Arrange var controller = new CustomersController(); var expectedValue = true; //Act bool withdraw = controller.AccountWithdraw("5500", 5000, "CAD"); bool transfer = controller.FundTransfer("1010", "5500", 7300, "CAD"); bool deposit = controller.AccountDeposit("1010", 13726, "MXN"); //Assert Assert.Equal(expectedValue, withdraw); Assert.Equal(expectedValue, transfer); Assert.Equal(expectedValue, deposit); //Act var account1010 = controller.GetCustomerAccount("1010"); var account5500 = controller.GetCustomerAccount("5500"); //Assert Assert.NotNull(account1010); Assert.NotNull(account5500); _output.WriteLine("Account Number: {0} Balance: ${1} CAD", account1010.AccountNo, account1010.AccountBalance.ToString("N", CultureInfo.InvariantCulture)); _output.WriteLine("Account Number: {0} Balance: ${1} CAD", account5500.AccountNo, account5500.AccountBalance.ToString("N", CultureInfo.InvariantCulture)); }
public void CaseFour() { //Arrange var controller = new CustomersController(); var expectedValue = true; //Act bool withdraw = controller.AccountWithdraw("0123", 70, "USD"); bool deposit = controller.AccountDeposit("0456", 23789, "USD"); bool transfer = controller.FundTransfer("0456", "0123", 23.75, "CAD"); //Assert Assert.Equal(expectedValue, withdraw); Assert.Equal(expectedValue, deposit); Assert.Equal(expectedValue, transfer); //Act var account0123 = controller.GetCustomerAccount("0123"); var account0456 = controller.GetCustomerAccount("0456"); //Assert Assert.NotNull(account0123); Assert.NotNull(account0456); _output.WriteLine("Account Number: {0} Balance: ${1} CAD", account0123.AccountNo, account0123.AccountBalance.ToString("N", CultureInfo.InvariantCulture)); _output.WriteLine("Account Number: {0} Balance: ${1} CAD", account0456.AccountNo, account0456.AccountBalance.ToString("N", CultureInfo.InvariantCulture)); }