public void CancellationTest() { int BasicFunc() => 10; var pool = new MyThreadPool(4); var task = pool.AddTask(BasicFunc); pool.Shutdown(); Thread.Sleep(50); Assert.Equal(10, task.Result); Assert.Equal(0, pool.ThreadsCount()); }
public void ThreadNumberTest() { var pool = new MyThreadPool(5); Assert.Equal(5, pool.ThreadsCount()); }