public void TestDefaultConstructor()
        {
            ThreadCallbackOperation test = new ThreadCallbackOperation(
                new ThreadStart(errorCallback)
                );

            Assert.IsFalse(test.Ended);
        }
        public void TestForwardExceptionFromExplicitThread()
        {
            ThreadCallbackOperation test = new ThreadCallbackOperation(
                new ThreadStart(errorCallback), false
                );

            Assert.IsFalse(test.Ended);
            test.Start();
            Assert.Throws <AbortedException>(
                delegate() { test.Join(); }
                );
        }
    public void TestExecutionInThreadPool() {
      TestCallbackProvider callbackProvider = new TestCallbackProvider();

      ThreadCallbackOperation test = new ThreadCallbackOperation(
        new ThreadStart(callbackProvider.Callback), true
      );

      Assert.IsFalse(test.Ended);
      Assert.IsFalse(callbackProvider.Called);
      test.Start();
      test.Join();
      Assert.IsTrue(test.Ended);
      Assert.IsTrue(callbackProvider.Called);
    }
        public void TestExecutionInExplicitThread()
        {
            TestCallbackProvider callbackProvider = new TestCallbackProvider();

            ThreadCallbackOperation test = new ThreadCallbackOperation(
                new ThreadStart(callbackProvider.Callback), false
                );

            Assert.IsFalse(test.Ended);
            Assert.IsFalse(callbackProvider.Called);
            test.Start();
            test.Join();
            Assert.IsTrue(test.Ended);
            Assert.IsTrue(callbackProvider.Called);
        }
 public void TestDefaultConstructor() {
   ThreadCallbackOperation test = new ThreadCallbackOperation(
     new ThreadStart(errorCallback)
   );
   Assert.IsFalse(test.Ended);
 }
    public void TestForwardExceptionFromExplicitThread() {
      ThreadCallbackOperation test = new ThreadCallbackOperation(
        new ThreadStart(errorCallback), false
      );

      Assert.IsFalse(test.Ended);
      test.Start();
      Assert.Throws<AbortedException>(
        delegate() { test.Join(); }
      );
    }