Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 void OnResetExecute()
 {
     SelectedPerson.RejectChanges();
 }