public void ShouldAcceptChangesOfComplexProperties()
        {
            var wrapper = new TestFriendWrapper(_testFriend);
            var address = new TestFriendAddress();

            wrapper.TestFriendAddress = new TestFriendAddressWrapper(address);
            wrapper.AcceptChanges();
            Assert.AreEqual(wrapper.Model.TestFriendAddress, address);
        }
Beispiel #2
0
        public void ShouldAcceptChanges()
        {
            var wrapper = new TestFriendWrapper(_testFriend);

            wrapper.TestFriendAddress.City = "Salt Lake City";
            Assert.AreEqual("Müllheim", wrapper.TestFriendAddress.CityOriginalValue);

            wrapper.AcceptChanges();

            Assert.IsFalse(wrapper.IsChanged);
            Assert.AreEqual("Salt Lake City", wrapper.TestFriendAddress.City);
            Assert.AreEqual("Salt Lake City", wrapper.TestFriendAddress.CityOriginalValue);
        }
Beispiel #3
0
        public void ShouldAcceptChanges()
        {
            var wrapper = new TestFriendWrapper(_testFriend);

            var emailToModify = wrapper.Emails.First();

            emailToModify.Email = "*****@*****.**";

            Assert.IsTrue(wrapper.IsChanged);

            wrapper.AcceptChanges();

            Assert.IsFalse(wrapper.IsChanged);
            Assert.AreEqual("*****@*****.**", emailToModify.Email);
            Assert.AreEqual("*****@*****.**", emailToModify.EmailOriginalValue);
        }
        public void ShouldAcceptChanges()
        {
            var wrapper = new TestFriendWrapper(_testFriend);

            wrapper.FirstName = "Julia";
            Assert.AreEqual("Julia", wrapper.FirstName);
            Assert.AreEqual("Thomas", wrapper.FirstNameOriginalValue);
            Assert.IsTrue(wrapper.FirstNameIsChanged);
            Assert.IsTrue(wrapper.IsChanged);

            wrapper.AcceptChanges();

            Assert.AreEqual("Julia", wrapper.FirstName);
            Assert.AreEqual("Julia", wrapper.FirstNameOriginalValue);
            Assert.IsFalse(wrapper.FirstNameIsChanged);
            Assert.IsFalse(wrapper.IsChanged);
        }