public void TestChoice() { SmartThreadPool stp = new SmartThreadPool(); int index = stp.Choice( () => Thread.Sleep(1000), () => Thread.Sleep(1500), () => Thread.Sleep(500)); Assert.AreEqual(2, index); index = stp.Choice( () => Thread.Sleep(300), () => Thread.Sleep(100), () => Thread.Sleep(200)); Assert.AreEqual(1, index); stp.Shutdown(); }