public void ShouldRejectChangesForComplexProperties() { Initialize(); var adapter = new PocoTestAdapter(_tester); adapter.ComplexProp.Description = "Something Different"; Assert.Equal("Something Different", adapter.ComplexProp.Description); Assert.True(adapter.ComplexProp.IsChanged); Assert.True(adapter.IsChanged); adapter.RejectChanges(); Assert.Equal("Like address", adapter.ComplexProp.Description); Assert.False(adapter.ComplexProp.IsChanged); Assert.False(adapter.IsChanged); }
public void ShouldRejectChanges() { Initialize(); var adapter = new PocoTestAdapter(_tester); var listItemToModify = adapter.Items.First(); listItemToModify.Description = "modified item"; Assert.True(adapter.IsChanged); adapter.RejectChanges(); Assert.False(adapter.IsChanged); Assert.Equal("Description01", listItemToModify.Description); Assert.Equal("Description01", listItemToModify.DescriptionOriginal); }
public void ShouldRejectChanges() { 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.RejectChanges(); Assert.Equal("Roger", adapter.TestName); Assert.Equal("Roger", adapter.TestNameOriginal); Assert.Equal(25, adapter.TestId); Assert.False(adapter.TestIdHasChanged); Assert.False(adapter.IsChanged); }