public void ValidTagAddress_IsValid() { string value = "*****@*****.**"; var attr = new EmailAddressAttribute() { AllowMultiple = true, }; var result = attr.GetIsValid(value, null); Assert.IsNull(result); }
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."); }
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")); }