示例#1
0
        public void TestCase04_Validation_ThrowOnError_InvalidEntity()
        {
            TestDummy dummy = new TestDummy {
                TextValue = "zzzzabc12", NumericValue = 16, BooleanValue = null
            };

            EntityValidator <TestDummy>    validator = new EntityValidator <TestDummy>();
            ICollection <ValidationResult> results   = validator.PerformValidation(dummy, true);
        }
示例#2
0
        public void TestCase03_Validation_ThrowOnError_ValidEntity()
        {
            TestDummy dummy = new TestDummy {
                TextValue = "zzzzabc12", NumericValue = 11, BooleanValue = false
            };

            EntityValidator <TestDummy>    validator = new EntityValidator <TestDummy>();
            ICollection <ValidationResult> results   = validator.PerformValidation(dummy, true);

            Assert.IsNotNull(results);
            Assert.AreEqual(0, results.Count);
        }
示例#3
0
        public void TestCase02_Validation_InvalidEntity()
        {
            TestDummy dummy = new TestDummy {
                TextValue = "zzzzabc12", NumericValue = 16, BooleanValue = null
            };

            EntityValidator <TestDummy>    validator = new EntityValidator <TestDummy>();
            ICollection <ValidationResult> results   = validator.PerformValidation(dummy);

            Assert.IsNotNull(results);
            Assert.AreEqual(2, results.Count);
        }