public void required_unique_email_returns_true_with_two_unique_emails() { // Arrange List<string> emailList = new List<string>(); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); bool requiredToBeUnique = true; // Act var rule = new RequireUniqueEmail(emailList, requiredToBeUnique); bool actual = rule.Validate(); // Assert Assert.IsTrue(actual); }
public void required_unique_email_returns_true_with_duplicate_emails_found_but_is_not_required() { // Arrange List<string> emailList = new List<string>(); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); bool requiredToBeUnique = false; // Act var rule = new RequireUniqueEmail(emailList, requiredToBeUnique); bool actual = rule.Validate(); // Assert Assert.IsTrue(actual); }