public void Test()
 {
     Utilities.Validation.Rules.IsEmailAddress<ClassD> TestObject = new IsEmailAddress<ClassD>(x => x.ItemA, "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "*****@*****.**";
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = "Not an email address";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
Esempio n. 2
0
        public void Test()
        {
            Utilities.Validation.Rules.IsEmailAddress <ClassD> TestObject = new IsEmailAddress <ClassD>(x => x.ItemA, "Error");
            ClassD Temp = new ClassD();

            Temp.ItemA = "*****@*****.**";
            Assert.DoesNotThrow(() => TestObject.Validate(Temp));
            Temp.ItemA = "Not an email address";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }