Example #1
0
        public void Validate_GivenProviderTypeIsEmpty_ShouldReturnValidationError()
        {
            // Arrange
            MasterProviderModelValidator validatorUnderTest      = new MasterProviderModelValidator();
            MasterProviderModel          providerModelToValidate = GetMasterProviderModel(m => m.MasterProviderTypeGroupName = string.Empty);

            // Act
            ValidationResult validationResult = validatorUnderTest.Validate(providerModelToValidate);

            // Assert
            validationResult
            .Errors
            .Should().NotBeNullOrEmpty();

            validationResult
            .Errors
            .Count.Should().Be(1);

            validationResult
            .Errors[0]
            .ErrorMessage
            .Should().Be("Urn: 123432 - Provider Type Group Name column was empty");

            validationResult
            .IsValid
            .Should().BeFalse();
        }
Example #2
0
        public void Validate_GivenModelIsValid_ShouldReturnEmptyValidationResult()
        {
            // Arrange
            MasterProviderModelValidator validatorUnderTest      = new MasterProviderModelValidator();
            MasterProviderModel          providerModelToValidate = GetMasterProviderModel();

            // Act
            ValidationResult validationResult = validatorUnderTest.Validate(providerModelToValidate);

            // Assert
            validationResult
            .Errors
            .Should().BeEmpty();

            validationResult
            .IsValid
            .Should().BeTrue();
        }