public void SearchPupilsViewModel_IsInvalid_GivenSearchTypeIsPupilIDAndTooLongULN(string check)
        {
            // Arrange
            var viewModel = new SearchPupilsViewModel(check)
            {
                SearchType = QueryType.PupilID,
                PupilID    = "12345678901"
            };

            var validator = new SearchPupilsViewModelValidator();

            // Act
            var result = validator.Validate(viewModel);

            // Assert
            Assert.False(result.IsValid);
        }
        public void SearchPupilsViewModel_IsValid_GivenSearchTypeIsPupilIDAndValidPupilID(string check)
        {
            // Arrange
            var viewModel = new SearchPupilsViewModel(check)
            {
                SearchType = QueryType.PupilID,
                PupilID    = "D79"
            };

            var validator = new SearchPupilsViewModelValidator();

            // Act
            var result = validator.Validate(viewModel);

            // Assert
            Assert.True(result.IsValid);
        }
        public void SearchPupilsViewModel_IsInvalid_GivenSearcgTypeIsNameAndAtLeast2Chars(string check)
        {
            // Arrange
            var viewModel = new SearchPupilsViewModel(check)
            {
                SearchType = QueryType.Name,
                Name       = "hh"
            };

            var validator = new SearchPupilsViewModelValidator();

            // Act
            var result = validator.Validate(viewModel);

            // Assert
            Assert.True(result.IsValid);
        }
        public void SearchPupilsViewModel_IsInvalid_GivenSearchTypeIsNameAndInvalidNameFormat(string check)
        {
            // Arrange
            var viewModel = new SearchPupilsViewModel(check)
            {
                SearchType = QueryType.Name,
                Name       = "R2-D2"
            };

            var validator = new SearchPupilsViewModelValidator();

            // Act
            var result = validator.Validate(viewModel);

            // Assert
            Assert.False(result.IsValid);
        }
        public void SearchPupilsViewModel_IsValid_GivenSearcgTypeIsNameAndValidName(string check)
        {
            // Arrange
            var viewModel = new SearchPupilsViewModel(check)
            {
                SearchType = QueryType.Name,
                Name       = "Hector d'Arras Sausage-Hausen, Jr."
            };

            var validator = new SearchPupilsViewModelValidator();

            // Act
            var result = validator.Validate(viewModel);

            // Assert
            Assert.True(result.IsValid);
        }