public void DisposeDispatcherFirst() { ManualDispatcher dispatcher = new ManualDispatcher(); IActionQueue queue = dispatcher.CreateQueue(); dispatcher.Dispose(); Assert.IsNull(queue.Dispatcher); ((IDisposable)queue).Dispose(); }
public void DisposeQueueInsideAction() { ManualDispatcher dispatcher = new ManualDispatcher(); IActionQueue queue = dispatcher.CreateQueue(); queue.Enqueue(() => {}); queue.Enqueue(() => { ((IDisposable)queue).Dispose(); }); queue.Enqueue(() => {}); dispatcher.ProcessQueues(); dispatcher.Dispose(); }
public void DisposeQueueFirst() { ManualDispatcher dispatcher = new ManualDispatcher(); IActionQueue queue = dispatcher.CreateQueue(); string name = queue.Name; ((IDisposable)queue).Dispose(); Assert.IsNull(queue.Dispatcher); Assert.IsNull(dispatcher.GetQueueByName(name)); dispatcher.Dispose(); }