public void CreditCard_WithdrawInLimit_ShouldDecreaseLimit() { var creditCard = new CreditCardBuilder() .WithLimit(100) .Build(); creditCard.Withdraw(50); creditCard.AvaliableLimit.Should().Be(50); }
public void CreditCard_WithdrawWithoutAssignedLimit_ShouldBeImposible() { var creditCard = new CreditCardBuilder() .Build(); Action act = () => creditCard.Withdraw(100); act.Should() .Throw <InvalidOperationException>() .WithMessage("Lack of funds"); }