public void Should_validate_successfully_when_the_command_is_valid()
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeTrue();
        }
        public void Should_fail_validation_when_the_card_number_is_not_valid(string cardNumber)
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            command.CardNumber = cardNumber;

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeFalse();
        }
        public void Should_fail_validation_when_the_ccv_is_not_three_digits(int ccv)
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            command.Ccv = ccv;

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeFalse();
        }
        public void Should_fail_validation_when_the_currency_is_invalid()
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            command.Money = new MoneyDto {
                Amount = 10, Currency = (Currency)1337
            };

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeFalse();
        }
        public void Should_fail_validation_when_the_amount_is_not_greater_than_zero(int amount)
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            command.Money = new MoneyDto {
                Amount = amount, Currency = Currency.EUR
            };

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeFalse();
        }
        public void Should_fail_validation_when_the_expiry_date_is_outdated(int year, int month)
        {
            // Arrange
            var command = SubmitCommandFactory.CreateValidCommand();

            command.ExpiryDate = new ExpiryDateDto {
                Year = year, Month = month
            };

            // Act
            var validation = _validator.Validate(command);

            // Assert
            validation.IsValid.Should().BeFalse();
        }