public void TestAddWorkToDisposedWorker()
        {
            WaitAndContinueWorker work = new WaitAndContinueWorker();
            work.Complete(false, 100);
            work.Dispose();

            SampleWork item = new SampleWork();
            work.AddWork(item);
        }
        public void TestAddWorkListToDisposedWorker()
        {
            WaitAndContinueWorker work = new WaitAndContinueWorker();
            work.Complete(false, 100);
            work.Dispose();

            WaitAndContinueList list = new WaitAndContinueList();
            list.AddWork(new SampleWork());

            work.AddWork(list);
        }
        public void TestCompleteWork()
        {
            using (WaitAndContinueWorker work = new WaitAndContinueWorker())
            {
                work.OnError += delegate(object o, ErrorEventArgs e) { throw new Exception("Failed.", e.GetException()); };

                SampleWork item = new SampleWork();
                work.AddWork(item);

                Assert.IsFalse(work.IsEmpty);
                work.Complete(true, 10);

                Assert.IsFalse(item.Completed);
                Assert.IsTrue(item.Disposed);
            }
        }