public void VerifyCollectionNotEmptyValidation()
        {
            var rng = new OwnCollectionAnotherClassTest() { List = new List<AnotherClassTest>() };
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);
            Assert.IsFalse(res);
        }
        public void VerifyCollectionValidation()
        {
            var rng = new OwnCollectionAnotherClassTest() { List = new List<AnotherClassTest>() };
            rng.List.Add(new AnotherClassTest() { Property1 = "bla", Property2 = "BEA" });
            rng.List.Add(new AnotherClassTest() { Property1 = "bla" }); //this is invalid
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);
            Assert.IsFalse(res);
        }
        public void VerifyCollectionNotEmptyValidation()
        {
            var rng = new OwnCollectionAnotherClassTest()
            {
                List = new List <AnotherClassTest>()
            };
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);

            Assert.IsFalse(res);
        }
        public void VerifyCollectionValidationIndexingOfPropertyInErrorList()
        {
            var rng = new OwnCollectionAnotherClassTest()
            {
                List = new List <AnotherClassTest>()
            };

            rng.List.Add(new AnotherClassTest()
            {
                Property1 = "bla", Property2 = "BEA"
            });
            rng.List.Add(new AnotherClassTest()
            {
                Property1 = "bla"
            });                                                                     //this is invalid
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);

            Assert.That(res.Errors[0].SourceName, Is.EqualTo("List[1].Property2"));
        }
        public void VerifyCollectionValidation()
        {
            var rng = new OwnCollectionAnotherClassTest()
            {
                List = new List <AnotherClassTest>()
            };

            rng.List.Add(new AnotherClassTest()
            {
                Property1 = "bla", Property2 = "BEA"
            });
            rng.List.Add(new AnotherClassTest()
            {
                Property1 = "bla"
            });                                                                     //this is invalid
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);

            Assert.IsFalse(res);
        }
        public void VerifyCollectionValidationIndexingOfPropertyInErrorList()
        {
            var rng = new OwnCollectionAnotherClassTest() { List = new List<AnotherClassTest>() };
            rng.List.Add(new AnotherClassTest() { Property1 = "bla", Property2 = "BEA" });
            rng.List.Add(new AnotherClassTest() { Property1 = "bla" }); //this is invalid
            var v = new Core.Validator();

            var res = v.ValidateObject(rng, ValidationFlags.RecursiveValidation);
            Assert.That(res.Errors[0].SourceName, Is.EqualTo("List[1].Property2"));
        }