Exemplo n.º 1
0
        public void BeValidWithCorrectCardType_WhenCreditCardSubmittedForVerification(CreditCardHandlerCreator creditCardHandlerCreator, string cardNumber)
        {
            // Arrange
            var creditCard = PrepareCreditCardPayment(cardNumber);
            var expectedCreditCardHandler = creditCardHandlerCreator(_paymentGateway);

            // Act
            var isValid = _creditCardHandler.IsCreditCardValid(creditCard);

            // Assert
            using (new FluentAssertions.Execution.AssertionScope("credit card"))
            {
                isValid.Should().BeTrue();
                _paymentGateway.IsCalledWith(creditCard, Times.Once(), expectedCreditCardHandler);
            }
        }