Ejemplo n.º 1
0
        public void Validate_ModelWithForbiddenValues_IsValid()
        {
            var model = new ModelWithForbiddenValues
            {
                Email = EmailAddress.Parse("*****@*****.**"),
            };

            DataAnnotationsAssert.IsValid(model);
        }
Ejemplo n.º 2
0
        public void Validate_ModelWithForbiddenValues_WithError()
        {
            var model = new ModelWithForbiddenValues
            {
                Email = EmailAddress.Parse("*****@*****.**"),
            };

            DataAnnotationsAssert.WithErrors(model,
                                             ValidationTestMessage.Error("The value of the Email field is not allowed.", "Email"));
        }