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); }
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); }