Esempio n. 1
0
        public void ShouldAcceptChangesForComplexProperties()
        {
            Initialize();
            var adapter = new PocoTestAdapter(_tester);

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

            adapter.AcceptChanges();

            Assert.Equal("Something Different", adapter.ComplexProp.Description);
            Assert.False(adapter.ComplexProp.IsChanged);
            Assert.False(adapter.IsChanged);
        }
Esempio n. 2
0
        public void ShouldAcceptChanges()
        {
            Initialize();
            var adapter = new PocoTestAdapter(_tester);

            var listItemToModify = adapter.Items.First();

            listItemToModify.Description = "modified item";

            Assert.True(adapter.IsChanged);

            adapter.AcceptChanges();

            Assert.False(adapter.IsChanged);
            Assert.Equal("modified item", listItemToModify.Description);
            Assert.Equal("modified item", listItemToModify.DescriptionOriginal);
        }
Esempio n. 3
0
        public void ShouldAcceptChanges()
        {
            Initialize();
            var adapter = new PocoTestAdapter(_tester);

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

            adapter.AcceptChanges();

            Assert.Equal("Sandra", adapter.TestName);
            Assert.Equal("Sandra", adapter.TestNameOriginal);
            Assert.False(adapter.TestIdHasChanged);
            Assert.False(adapter.IsChanged);
        }