Exemplo n.º 1
0
        public void ModelWithHasNoIdentificationNumber_ValidModel_ReturnsExpectedResults(string identificationNumber, bool hasNoIdentificationNumber)
        {
            // Arrange
            var model = new ModelWithHasNoIdentificationNumber()
            {
                IdentificationNumber      = identificationNumber,
                HasNoIdentificationNumber = hasNoIdentificationNumber
            };

            // Act
            var result = ModelValidator.Validate(model);

            // Assert
            AssertIsValid(result);
        }
Exemplo n.º 2
0
        public void ModelWithHasNoIdentificationNumber_InvalidModel_ReturnsExpectedResults(string identificationNumber, bool hasNoIdentificationNumber)
        {
            // Arrange
            var model = new ModelWithHasNoIdentificationNumber()
            {
                IdentificationNumber      = identificationNumber,
                HasNoIdentificationNumber = hasNoIdentificationNumber
            };

            // Act
            var result = ModelValidator.Validate(model);

            // Assert
            AssertIsNotValid(result, nameof(model.IdentificationNumber), typeof(IdentificationNumberAttribute), ValidationType.IdentificationNumber);
        }