public void AddThenClear_Processed_NoItemsAdded() { var list = new DelayedList <object>(); Fill(list, 5); list.Clear(); list.ProcessPending(); Assert.IsEmpty(list); }
public void Clear_Processed_AllItemsRemoved() { var list = new DelayedList <object>(); Fill(list, 5); list.ProcessPending(); list.Clear(); list.ProcessPending(); Assert.IsEmpty(list); }
public void ClearThenAdd_Processed_OnlyAddedItemLeft() { var list = new DelayedList <object>(); var item = new object(); Fill(list, 5); list.ProcessPending(); list.Clear(); list.Add(item); list.ProcessPending(); Assert.AreEqual(1, list.Count); Assert.AreSame(item, list[0]); }
/// <summary> /// Clears all listeners /// </summary> public void Clear() { _listeners.Clear(); }