private async Task TestAsyncOperationSwitchToPoolInner(StaticThreadPool testInst)
        {
            Assert.IsFalse(testInst.IsThreadPoolThread);

            System.IO.StreamWriter writer = null;
            string fileName = Guid.NewGuid().ToString().Replace('-', '_');

            try
            {
                writer = new System.IO.StreamWriter(new System.IO.FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.ReadWrite, 128, true));

                await testInst.SwitchToPool();

                Assert.IsTrue(testInst.IsThreadPoolThread);

                string longString = "test test test test test test test test test test test test";
                for (int i = 0; i < 10; i++)
                {
                    longString += longString;
                }

                await writer.WriteLineAsync(longString);

                Assert.IsTrue(testInst.IsThreadPoolThread);
            }
            finally
            {
                if (writer != null)
                {
                    writer.Close();
                }

                System.IO.File.Delete(fileName);
            }
        }
        private async Task TestSwitchToPoolWorkInner(StaticThreadPool testInst)
        {
            Assert.IsFalse(testInst.IsThreadPoolThread);
            //Assert.IsNull(SynchronizationContext.Current);

            await testInst.SwitchToPool();

            Assert.IsTrue(testInst.IsThreadPoolThread);
            //Assert.IsNotNull(SynchronizationContext.Current);
        }