Example #1
0
        public void Test1()
        {
            ValidateSample1 s      = new ValidateSample1();
            var             v      = ValidatorFactory.CreateInstance().CreateValidator <ValidateSample1>();
            var             result = v.Check(s);

            Assert.IsTrue(result.IsError("Salary"), "Salary");
            Assert.IsTrue(result.IsError("Code"), "Code");
            Assert.IsTrue(result.IsError("Name"), "Name");

            this.WriteResultToConsole(result);
        }
Example #2
0
        public void Test1()
        {
            ValidateSample1 s = new ValidateSample1();
            var v = ValidatorFactory.CreateInstance().CreateValidator<ValidateSample1>();
            var result = v.Check(s);

            Assert.IsTrue(result.IsError("Salary"), "Salary");
            Assert.IsTrue(result.IsError("Code"), "Code");
            Assert.IsTrue(result.IsError("Name"), "Name");

            this.WriteResultToConsole(result);
        }
Example #3
0
        public void Test3()
        {
            ValidateSample1 s = new ValidateSample1();
            s.Name = "ABCDEFG HIJKLMN O";
            s.Code = "123-45678";
            s.Salary = 100;
            var v = ValidatorFactory.CreateInstance().CreateValidator<ValidateSample1>();
            var result = v.Check(s);

            Assert.IsTrue(result.IsError("Name"), "Name");
            Assert.IsFalse(result.IsError("Salary"), "Salary");
            Assert.IsTrue(result.IsError("Code"), "Code");

            this.WriteResultToConsole(result);
        }
Example #4
0
        public void Test3()
        {
            ValidateSample1 s = new ValidateSample1();

            s.Name   = "ABCDEFG HIJKLMN O";
            s.Code   = "123-45678";
            s.Salary = 100;
            var v      = ValidatorFactory.CreateInstance().CreateValidator <ValidateSample1>();
            var result = v.Check(s);

            Assert.IsTrue(result.IsError("Name"), "Name");
            Assert.IsFalse(result.IsError("Salary"), "Salary");
            Assert.IsTrue(result.IsError("Code"), "Code");

            this.WriteResultToConsole(result);
        }