public void ShouldRejectChanges() { var wrapper = new PersonWrapper(_person); wrapper.Address.StreetName = "XYZ"; Assert.AreEqual("ChemCentre, Perth", wrapper.Address.StreetNameOriginalValue); wrapper.RejectChanges(); Assert.IsFalse(wrapper.IsChanged); Assert.AreEqual("ChemCentre, Perth", wrapper.Address.StreetName); Assert.AreEqual("ChemCentre, Perth", wrapper.Address.StreetNameOriginalValue); }
public void ShouldRejectChanges() { var wrapper = new PersonWrapper(_person); var emailToModify = wrapper.Emails.First(); emailToModify.EmailAddress = "*****@*****.**"; Assert.IsTrue(wrapper.IsChanged); wrapper.RejectChanges(); Assert.IsFalse(wrapper.IsChanged); Assert.AreEqual("*****@*****.**", emailToModify.EmailAddress); Assert.AreEqual("*****@*****.**", emailToModify.EmailAddressOriginalValue); }
public void ShouldRejectChanges() { var wrapper = new PersonWrapper(_person); wrapper.Name = "Nik"; Assert.AreEqual("Nik", wrapper.Name); Assert.AreEqual("Tarique Memon", wrapper.NameOriginalValue); Assert.IsTrue(wrapper.NameIsChanged); Assert.IsTrue(wrapper.IsChanged); wrapper.RejectChanges(); Assert.AreEqual("Tarique Memon", wrapper.Name); Assert.AreEqual("Tarique Memon", wrapper.NameOriginalValue); Assert.IsFalse(wrapper.NameIsChanged); Assert.IsFalse(wrapper.IsChanged); }
void OnResetExecute() { SelectedPerson.RejectChanges(); }