Пример #1
0
        public void Perform_Withdrawal_CheckBalance()
        {
            //Arrange
            decimal OpeningBalance = 10;
            decimal AmountToWithdraw = 50;
            BankAccount ba = new BankAccount("Jherna Mamtora", OpeningBalance);

               //Act
            ba.Withdraw(AmountToWithdraw);

               //Assert

            decimal ExpectedBalance = OpeningBalance - AmountToWithdraw;
            Assert.AreEqual(ExpectedBalance, ba.Balance);
        }
Пример #2
0
        public void Check_OpeningBalance()
        {
            //Arrange
            decimal OpeningBalance = 100;

            BankAccount ba = new BankAccount("Jherna Mamtora", OpeningBalance);

            //Act

            decimal ActualBalance = ba.Balance;
            //Assert

            decimal ExpectedBalance =OpeningBalance;

            Assert.AreEqual(ExpectedBalance, ActualBalance);
        }
Пример #3
0
        public void WithdrawLessThanZero_RaiseException()
        {
            //Arrange
               decimal OpeningBalance = 100;
               decimal AmountToWithdraw = -5;
               BankAccount ba = new BankAccount("Jherna Mamtora", OpeningBalance);

               //Act

               ba.Withdraw(AmountToWithdraw);

               //Assert

               //decimal ExpectedBalance = OpeningBalance - AmountToWithdraw;
               //Assert.AreEqual(ExpectedBalance, ba.Balance);

               //  Assert.Fail();
        }