Example #1
0
        public void Should_Accept_Changes_For_Complex_Properties()
        {
            var adapter = new PocoTestAdapter(_tester);

            adapter.ComplexProp.Description = "Something Different";
            Assert.IsTrue(adapter.ComplexProp.IsChanged);
            Assert.IsTrue(adapter.IsChanged);

            adapter.AcceptChanges();

            Assert.AreEqual("Something Different", adapter.ComplexProp.Description);
            Assert.IsFalse(adapter.ComplexProp.IsChanged);
            Assert.IsFalse(adapter.IsChanged);
        }
Example #2
0
        public void Should_Accept_Changes_When_Called_On_Adapter()
        {
            var adapter = new PocoTestAdapter(_tester);

            var listItemToModify = adapter.Items.First();

            listItemToModify.Description = "modified item";

            Assert.IsTrue(adapter.IsChanged);

            adapter.AcceptChanges();

            Assert.IsFalse(adapter.IsChanged);
            Assert.AreEqual("modified item", listItemToModify.Description);
            Assert.AreEqual("modified item", listItemToModify.DescriptionOriginal);
        }
Example #3
0
        public void Should_Accept_Changes()
        {
            var adapter = new PocoTestAdapter(_tester);

            adapter.TestName = "Sandra";
            adapter.TestId   = 100;
            Assert.AreEqual("Sandra", adapter.TestName);
            Assert.AreEqual("Roger", adapter.TestNameOriginal);
            Assert.IsTrue(adapter.TestIdHasChanged);
            Assert.IsTrue(adapter.IsChanged);

            adapter.AcceptChanges();

            Assert.AreEqual("Sandra", adapter.TestName);
            Assert.AreEqual("Sandra", adapter.TestNameOriginal);
            Assert.IsFalse(adapter.TestIdHasChanged);
            Assert.IsFalse(adapter.IsChanged);
        }