Exemplo n.º 1
0
        public void Can_set_and_get_original_value_generic_notifying_entities()
        {
            var entity = new NotifyingWotty { Id = 1, Primate = "Monkey" };

            var entry = TestHelpers.Instance.CreateInternalEntry(
                BuildModel(),
                EntityState.Unchanged,
                entity);

            Assert.Equal("Monkey", new PropertyEntry<NotifyingWotty, string>(entry, "Primate").OriginalValue);

            new PropertyEntry<NotifyingWotty, string>(entry, "Primate").OriginalValue = "Chimp";

            Assert.Equal("Chimp", new PropertyEntry<NotifyingWotty, string>(entry, "Primate").OriginalValue);
            Assert.Equal("Monkey", entity.Primate);
        }