public void RemoveElementAndCheckForEvent() { itemCollection = this.PlainCollection(); int i = itemCollection.Count; BaseReportItem r = itemCollection[1]; Assert.AreEqual("t2", r.Name); itemCollection.Remove(r); Assert.AreEqual(i - 1, itemCollection.Count); }
public void Delete() { if (_viewModel.SelectedItem == null) { return; } if (MessageWindow.ConfirmDeleteRecord() == MessageBoxResult.Yes) { _viewModel.SelectedItem.Destroy(); _lookup.Remove(_lookup.FirstOrDefault(item => item.ID == _viewModel.SelectedItem.ID)); _viewModel.Collection.Remove(_viewModel.SelectedItem); } }
public void RemoveElementAndCheckForEvent() { itemCollection = this.PlainCollection(); int i = itemCollection.Count; itemCollection.Removed += OnRemoveItem; BaseReportItem r = itemCollection[1]; Assert.AreEqual("t2", r.Name); itemCollection.Remove(r); Assert.AreEqual(i - 1, itemCollection.Count); Assert.IsTrue(gotEvent, "No 'removed' Event"); gotEvent = false; }
public void RemoveElementAndCheckForEvent () { itemCollection = this.PlainCollection(); int i = itemCollection.Count; BaseReportItem r = itemCollection[1]; Assert.AreEqual("t2",r.Name); itemCollection.Remove (r); Assert.AreEqual(i-1,itemCollection.Count); }
public void RemoveElementAndCheckForEvent () { itemCollection = this.PlainCollection(); int i = itemCollection.Count; itemCollection.Removed += OnRemoveItem; BaseReportItem r = itemCollection[1]; Assert.AreEqual("t2",r.Name); itemCollection.Remove (r); Assert.AreEqual(i-1,itemCollection.Count); Assert.IsTrue(gotEvent,"No 'removed' Event"); gotEvent = false; }