コード例 #1
0
        public void DifferencingDetectsRemoveAsRemove()
        {
            var model = new Model();
            var lisa  = new Female {
                FullName = "Lisa Simpson"
            };

            AddSimpsons(model, lisa);

            var copy = Copy(model);

            lisa.Delete();

            var diff = GetDiff <IModel>(copy, model);

            Assert.AreEqual(1, diff.Changes.Count);
            var delete = diff.Changes.OfType <CompositionListDeletion>().FirstOrDefault();

            Assert.IsNotNull(delete);
            Assert.AreEqual("Lisa Simpson", (delete.DeletedElement as IFemale).FullName);
        }