예제 #1
0
        public void AddNewEditableObjectAndEndNew()
        {
            var factory = ViewFactory.IListIEditableObjectItems();
            var view    = factory.View;

            view.ItemType = factory.ListItemType;

            var added = (ObjectView)view.AddNew();

            ((ICancelAddNew)view).EndNew(view.IndexOf(added.Object));
            Assert.AreEqual(2, factory.ListChangedAddedCount);
        }
예제 #2
0
        public void AddNewEditableObjectAndCancelNew()
        {
            ViewFactory    factory = ViewFactory.IListIEditableObjectItems();
            ObjectListView view    = factory.View;

            view.ItemType = factory.ListItemType;

            ObjectView added = (ObjectView)view.AddNew();

            ((ICancelAddNew)view).CancelNew(view.IndexOf(added.Object));
            Assert.AreEqual(1, factory.ListChangedAddedCount);
            Assert.AreEqual(1, factory.ListChangedDeletedCount);
        }