public void NhsNumberWithWhiteSpacesReturnsErrors()
        {
            // Arrange
            var nhsNumberString   = "987£654 4321";
            var validationContext = new Mock <IServiceProvider>().Object;
            var expectedError     = nameof(SystemValidationErrors.ContainsWhitespace);
            var sut = new ValidNhsNumberNullAllowedAttribute();

            // Act
            var result = sut.GetValidationResult(nhsNumberString, new ValidationContext(validationContext));

            // Assert
            Assert.Equal(expectedError, result.ErrorMessage);
        }
        public void CorrectNhsNumberReturnsNoErrors()
        {
            // Arrange
            var nhsNumberString   = "9434765919";
            var validationContext = new Mock <IServiceProvider>().Object;
            var expectedResult    = ValidationResult.Success;
            var sut = new ValidNhsNumberNullAllowedAttribute();

            // Act
            var result = sut.GetValidationResult(nhsNumberString, new ValidationContext(validationContext));

            // Assert
            Assert.Equal(expectedResult, result);
        }
        public void ExcessDigitsInNumberReturnsErrors()
        {
            // Arrange
            var nhsNumberString   = "012345678910123456";
            var validationContext = new Mock <IServiceProvider>().Object;
            var expectedError     = nameof(SystemValidationErrors.Invalid);
            var sut = new ValidNhsNumberNullAllowedAttribute();

            // Act
            var result = sut.GetValidationResult(nhsNumberString, new ValidationContext(validationContext));

            // Assert
            Assert.Equal(expectedError, result.ErrorMessage);
        }
        public void Alphanumeric10DigitsNumberReturnsOk()
        {
            // Arrange
            var nhsNumberString   = "12345sa67890";
            var validationContext = new Mock <IServiceProvider>().Object;
            var sut            = new ValidNhsNumberNullAllowedAttribute();
            var expectedResult = ValidationResult.Success;

            // Act
            var result = sut.GetValidationResult(nhsNumberString, new ValidationContext(validationContext));

            // Assert
            Assert.Equal(expectedResult, result);
        }