Ejemplo n.º 1
0
        public void Debit_WhenWithdrawnIsHigherThanBalance_ShouldThrowArgumentOutOfRange()
        {
            // Arrange
            double beginningBalance = 11.99;
            double debitAmount      = 36.00;
            var    account          = new UnitTestPOC.BankAccount("Leon", beginningBalance);

            // Act and assert
            Assert.ThrowsException <System.ArgumentOutOfRangeException>(() => account.Debit(debitAmount));
        }
Ejemplo n.º 2
0
        public void Debit_WithValidAmount_UpdatesBalance()
        {
            // Arrange
            double beginningBalance = 11.99;
            double debitAmount      = 4.55;
            double expected         = 7.44;
            var    account          = new UnitTestPOC.BankAccount("Leon", beginningBalance);

            // Act
            account.Debit(debitAmount);

            // Assert
            double actual = account.Balance;

            Assert.AreEqual(expected, actual);
        }