示例#1
0
        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}"));
        }
示例#2
0
        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}"));
        }
示例#3
0
        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}"));
        }