public void ValidateSubject_Email_SubjectLongerThan20Chars_ShouldThrowError() { List <string> fields = new List <string>() { "*****@*****.**", "123456789012345678901", "\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.\"" }; Assert.ThrowsException <System.Exception>(() => EmailValidator.ValidateSubject(fields, 1, @"^SIR \d{1,2}/\d{1,2}/\d{4}$", @"^[a-zA-Z0-9_]{0,20}")); }
public void ValidateSortCode_Email_SIR_ValidSortCode_ShouldPass() { List <string> fields = new List <string>() { "*****@*****.**", "SIR 02/07/1995", "99-99-99", "Theft", "\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.\"" }; Assert.AreEqual("SIR", EmailValidator.ValidateSubject(fields, 1, @"^SIR \d{1,2}/\d{1,2}/\d{4}$", @"^[a-zA-Z0-9_]{0,20}")); }
public void ValidateSubject_Email_Sem_SubjectSpecified_ShouldPass() { List <string> fields = new List <string>() { "*****@*****.**", "Hello World", "\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.\"" }; Assert.AreEqual("SEM", EmailValidator.ValidateSubject(fields, 1, @"^SIR \d{1,2}/\d{1,2}/\d{4}$", @"^[a-zA-Z0-9_]{0,20}")); }