Esempio n. 1
0
        public void ModelWithNullableHasNoIdentificationNumber_ValidModel_ReturnsExpectedResults(string identificationNumber, bool?hasNoIdentificationNumber)
        {
            // Arrange
            var model = new ModelWithNullableHasNoIdentificationNumber()
            {
                IdentificationNumber      = identificationNumber,
                HasNoIdentificationNumber = hasNoIdentificationNumber
            };

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

            // Assert
            AssertIsValid(result);
        }
Esempio n. 2
0
        public void ModelWithNullableHasNoIdentificationNumber_InvalidModel_ReturnsExpectedResults(string identificationNumber, bool?hasNoIdentificationNumber)
        {
            // Arrange
            var model = new ModelWithNullableHasNoIdentificationNumber()
            {
                IdentificationNumber      = identificationNumber,
                HasNoIdentificationNumber = hasNoIdentificationNumber
            };

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

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