public void ShouldRejectChanges() { var wrapper = new EmployeeWrapper(_employee); wrapper.Address.City = "different city"; Assert.AreEqual(ChangeTrackingComplexProperties.City, wrapper.Address.CityOriginalValue); wrapper.RejectChanges(); Assert.IsFalse(wrapper.IsChanged); Assert.AreEqual(ChangeTrackingComplexProperties.City, wrapper.Address.City); Assert.AreEqual(ChangeTrackingComplexProperties.City, wrapper.Address.CityOriginalValue); }
public void ShouldRejectChanges() { var wrapper = new EmployeeWrapper(_employee); wrapper.FirstName = "Thien"; Assert.AreEqual("Thien", wrapper.FirstName); Assert.AreEqual("Van", wrapper.FirstNameOriginalValue); Assert.IsTrue(wrapper.FirstNameIsChanged); Assert.IsTrue(wrapper.IsChanged); wrapper.RejectChanges(); Assert.AreEqual("Van", wrapper.FirstName); Assert.AreEqual("Van", wrapper.FirstNameOriginalValue); Assert.IsFalse(wrapper.FirstNameIsChanged); Assert.IsFalse(wrapper.IsChanged); }
public void ShouldRejectChanges() { var wrapper = new EmployeeWrapper(_employee); wrapper.FirstName = "something different"; Assert.AreEqual("something different", wrapper.FirstName); Assert.AreEqual(ChangeTrackingSimpleProperties.FirstName, wrapper.FirstNameOriginalValue); Assert.IsTrue(wrapper.FirstNameIsChanged); Assert.IsTrue(wrapper.IsChanged); wrapper.RejectChanges(); Assert.AreEqual(ChangeTrackingSimpleProperties.FirstName, wrapper.FirstName); Assert.AreEqual(ChangeTrackingSimpleProperties.FirstName, wrapper.FirstNameOriginalValue); Assert.IsFalse(wrapper.FirstNameIsChanged); Assert.IsFalse(wrapper.IsChanged); }
public void ResetEntity() { SelectedItem.RejectChanges(); }