예제 #1
0
        public void CreditCard_WithdrawInLimit_ShouldDecreaseLimit()
        {
            var creditCard = new CreditCardBuilder()
                             .WithLimit(100)
                             .Build();

            creditCard.Withdraw(50);

            creditCard.AvaliableLimit.Should().Be(50);
        }
예제 #2
0
        public void CreditCard_WithdrawWithoutAssignedLimit_ShouldBeImposible()
        {
            var creditCard = new CreditCardBuilder()
                             .Build();

            Action act = () => creditCard.Withdraw(100);

            act.Should()
            .Throw <InvalidOperationException>()
            .WithMessage("Lack of funds");
        }