public void test_dirty_collection_aggregating()
        {
            TestClass objTest = new TestClass();
            TestChild objChild = new TestChild();

            List<IDirtyCapable> dirtyObjects = objTest.GetDirtyObjects();

            objTest.Children.Add(objChild);

            Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");

            objChild.ChildName = "test value";
            dirtyObjects = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 1, "There should be one dirty object.");

            objTest.DirtyProp = "test value";
            dirtyObjects = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 2, "There should be two dirty object.");

            objTest.CleanAll();
            dirtyObjects = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");
        }
Esempio n. 2
0
        public void test_dirty_collection_aggregating()
        {
            TestClass objTest  = new TestClass();
            TestChild objChild = new TestChild();

            List <IDirtyCapable> dirtyObjects = objTest.GetDirtyObjects();

            objTest.Children.Add(objChild);

            Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");

            objChild.ChildName = "test value";
            dirtyObjects       = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 1, "There should be one dirty object.");

            objTest.DirtyProp = "test value";
            dirtyObjects      = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 2, "There should be two dirty object.");

            objTest.CleanAll();
            dirtyObjects = objTest.GetDirtyObjects();

            Assert.IsTrue(dirtyObjects.Count == 0, "There should be no dirty object returned.");
        }
        public void test_collection_property_dirtyness()
        {
            TestClass objTest = new TestClass();
            TestChild objChild = new TestChild();

            objTest.Children.Add(objChild);

            Assert.IsFalse(objTest.IsAnythingDirty(), "Nothing in the object graph should be dirty.");

            objChild.ChildName = "test value";

            Assert.IsTrue(objTest.IsAnythingDirty(), "The test object should be reflecting dirtiness within.");
        }
Esempio n. 4
0
        public void test_collection_property_dirtyness()
        {
            TestClass objTest  = new TestClass();
            TestChild objChild = new TestChild();

            objTest.Children.Add(objChild);

            Assert.IsFalse(objTest.IsAnythingDirty(), "Nothing in the object graph should be dirty.");

            objChild.ChildName = "test value";

            Assert.IsTrue(objTest.IsAnythingDirty(), "The test object should be reflecting dirtiness within.");
        }