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));
 }
 public void Test()
 {
     Utilities.Validation.Rules.IsDomain<ClassD> TestObject = new IsDomain<ClassD>(x => x.ItemA, "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "http://www.google.com";
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = "Not a domain";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
Esempio n. 3
0
 public void Test()
 {
     Utilities.Validation.Rules.Regex<ClassD> TestObject = new Regex<ClassD>(x => x.ItemA, "A(.*)", "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "Test";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
     Temp.ItemA = "A test";
     Assert.DoesNotThrow(() => TestObject.Validate(Temp));
 }
Esempio n. 4
0
 public void Test()
 {
     Utilities.Validation.Rules.MinLength<ClassD, char> TestObject = new MinLength<ClassD, char>(x => x.ItemA, 4, "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "Test";
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = "Tes";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
 public void Test()
 {
     Utilities.Validation.Rules.RequiredString<ClassD> TestObject = new RequiredString<ClassD>(x => x.ItemA, "", "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "ASDF";
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = "";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
Esempio n. 6
0
        public void Test()
        {
            Utilities.Validation.Rules.NotRegex <ClassD> TestObject = new NotRegex <ClassD>(x => x.ItemA, "A(.*)", "Error");
            ClassD Temp = new ClassD();

            Temp.ItemA = "Test";
            Assert.DoesNotThrow <Exception>(() => TestObject.Validate(Temp));
            Temp.ItemA = "A test";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }
Esempio n. 7
0
        public void Test()
        {
            Utilities.Validation.Rules.RequiredString <ClassD> TestObject = new RequiredString <ClassD>(x => x.ItemA, "", "Error");
            ClassD Temp = new ClassD();

            Temp.ItemA = "ASDF";
            Assert.DoesNotThrow(() => TestObject.Validate(Temp));
            Temp.ItemA = "";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }
        public void Test()
        {
            Utilities.Validation.Rules.MinLength <ClassD, char> TestObject = new MinLength <ClassD, char>(x => x.ItemA, 4, "Error");
            ClassD Temp = new ClassD();

            Temp.ItemA = "Test";
            Assert.DoesNotThrow <Exception>(() => TestObject.Validate(Temp));
            Temp.ItemA = "Tes";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }
Esempio n. 9
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));
        }
Esempio n. 10
0
        public void Test()
        {
            Utilities.Validation.Rules.IsDomain <ClassD> TestObject = new IsDomain <ClassD>(x => x.ItemA, "Error");
            ClassD Temp = new ClassD();

            Temp.ItemA = "http://www.google.com";
            Assert.DoesNotThrow <Exception>(() => TestObject.Validate(Temp));
            Temp.ItemA = "Not a domain";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }