예제 #1
0
            public void ValidTagAddress_IsValid()
            {
                string value = "*****@*****.**";
                var    attr  = new EmailAddressAttribute()
                {
                    AllowMultiple = true,
                };
                var result = attr.GetIsValid(value, null);

                Assert.IsNull(result);
            }
예제 #2
0
            public void EmptyValue_IsValid()
            {
                string value = "";
                var    attr  = new EmailAddressAttribute()
                {
                    AllowMultiple = true,
                };
                var result = attr.GetIsValid(value, null);

                Assert.IsNull(result);
                //Assert.AreEqual(result.ErrorMessage, "A valid email address is required.");
            }
예제 #3
0
            public void MultiValidAddressAndMax1_IsValid()
            {
                string value = "[email protected] [email protected] [email protected] cool";
                var    attr  = new EmailAddressAttribute()
                {
                    AllowMultiple    = true,
                    MaximumAddresses = 1,
                };
                var result = attr.GetIsValid(value, null);

                Assert.IsNotNull(result);
                Assert.IsTrue(result.ErrorMessage.Contains("maximum of"));
            }