public void Invokeで別タスクで実行される()
            {
                Task task = new Task(() => threadId = Thread.CurrentThread.ManagedThreadId);
                BackgroundTask sut = new BackgroundTask(task);

                sut.Invoke();
                Task.WaitAll(task);

                Assert.That(threadId, Is.Not.EqualTo(Thread.CurrentThread.ManagedThreadId));
            }
            public void Invokeで別タスクが実行される()
            {
                using (CountdownEvent cde = new CountdownEvent(1))
                {
                    Task task = new Task(() => {
                        threadId = Thread.CurrentThread.ManagedThreadId;
                        cde.Signal();
                    });

                    BackgroundTask sut = new BackgroundTask(task);

                    sut.Invoke();
                    cde.Wait();
                }

                Assert.That(threadId, Is.Not.EqualTo(Thread.CurrentThread.ManagedThreadId));
            }