예제 #1
0
        public void ShouldGenerateRemoveEvent()
        {
            var list = new SimpleDeltaStringList();

            list.TestBar.Add("hello");
            list.ClearEvents();             // throw away changes

            list.TestBar.Remove("hello");
            Assert.Equal(0, list.TestBar.Count);

            var root = AssertGenerated(list);
            var e    = root.Events[0];

            Assert.Equal(ListAction.RemoveList, e.ListEvent.ListAction);
            AssertPath(e, new[] { 11 });
        }
예제 #2
0
        public void ShouldGenerateInsertEvent()
        {
            var list = new SimpleDeltaStringList();

            list.TestBar.Add("hello");
            list.TestBar.Add("world");
            list.ClearEvents();             // throw away changes

            list.TestBar.Insert(1, "all");
            Assert.Equal(3, list.TestBar.Count);

            var root = AssertGenerated(list);
            var e    = root.Events[0];

            Assert.Equal(ListAction.InsertList, e.ListEvent.ListAction);
            AssertPath(e, new[] { 11 });
            Assert.Equal(1, e.ListEvent.Index);
        }