コード例 #1
0
        public void ValidateInherited2()
        {
            var              v   = new Core.Validator();
            ChildEntity      bes = new ChildEntity();
            ValidationResult res = v.ValidateObject(bes);

            Assert.That(res.Success, Is.False);
            Assert.That(res.ErrorMessages[0], Is.EqualTo("This is a required field"));
        }
コード例 #2
0
        public void ValidateInheritedGood()
        {
            var         v   = new Core.Validator();
            ChildEntity bes = new ChildEntity();

            bes.RequiredString = "this";
            ValidationResult res = v.ValidateObject(bes);

            Assert.That(res.Success, Is.True);
        }
コード例 #3
0
        public void ScannerInheritedTest()
        {
            var         v               = new Core.Validator();
            ChildEntity bes             = new ChildEntity();
            var         ts              = new TypeScanner(bes.GetType());
            ValidationUnitCollection vc = ts.Scan();

            Assert.That(vc, Has.Count.EqualTo(2));
            Assert.That(vc[1].ErrorMessage.Message, Is.EqualTo("This is a required field"));
        }
コード例 #4
0
 public void ScannerInheritedTest()
 {
     var v = new Core.Validator();
     ChildEntity bes = new ChildEntity();
     var ts = new TypeScanner(bes.GetType());
     ValidationUnitCollection vc = ts.Scan();
     Assert.That(vc, Has.Count.EqualTo(2));
     Assert.That(vc[1].ErrorMessage.Message, Is.EqualTo("This is a required field"));
 }
コード例 #5
0
 public void ValidateInheritedGood()
 {
     var v = new Core.Validator();
     ChildEntity bes = new ChildEntity();
     bes.RequiredString = "this";
     ValidationResult res = v.ValidateObject(bes);
     Assert.That(res.Success, Is.True);
 }
コード例 #6
0
 public void ValidateInherited2()
 {
     var v = new Core.Validator();
     ChildEntity bes = new ChildEntity();
     ValidationResult res = v.ValidateObject(bes);
     Assert.That(res.Success, Is.False);
     Assert.That(res.ErrorMessages[0], Is.EqualTo("This is a required field"));
 }