Exemplo n.º 1
0
        public void Validate_RequiredListFieldIsNull_ExceptionThrown()
        {
            // Assign
            var model = new TestModelRequired {
                Prop1 = "test"
            };

            // Act & Assert
            Assert.Throws <ModelValidationException>(() => _validator.Validate(model));
        }
Exemplo n.º 2
0
        public void Validate_RequiredFieldsNormal_Ok()
        {
            // Assign
            var model = new TestModelRequired {
                Prop1 = "test", Prop2 = new List <string>()
            };

            // Act & Assert
            _validator.Validate(model);
        }
Exemplo n.º 3
0
        public void Validate_UserTypeRequiredFieldIsNullOtherIsOk_ExceptionThrown()
        {
            // Assign
            var model = new TestModelRequired {
                Prop1 = "test", Prop2 = new List <string>()
            };

            // Act & Assert
            Assert.Throws <ModelValidationException>(() => _validator.Validate(model));
        }