Mercurial > pub > ImplabNet
diff Implab.Test/AsyncTests.cs @ 20:1c3b3d518480 promises
refactoring, sync
author | cin |
---|---|
date | Tue, 12 Nov 2013 02:27:22 +0400 |
parents | e3935fdf59a2 |
children | 6a56df4ec59e |
line wrap: on
line diff
--- a/Implab.Test/AsyncTests.cs Sun Nov 10 00:21:33 2013 +0400 +++ b/Implab.Test/AsyncTests.cs Tue Nov 12 02:27:22 2013 +0400 @@ -101,18 +101,18 @@ public void WorkerPoolSizeTest() { var pool = new WorkerPool(5, 10, 0); - Assert.AreEqual(5, pool.ThreadCount); + Assert.AreEqual(5, pool.PoolSize); pool.Invoke(() => { Thread.Sleep(1000000); return 10; }); pool.Invoke(() => { Thread.Sleep(1000000); return 10; }); pool.Invoke(() => { Thread.Sleep(1000000); return 10; }); - Assert.AreEqual(5, pool.ThreadCount); + Assert.AreEqual(5, pool.PoolSize); for (int i = 0; i < 100; i++) pool.Invoke(() => { Thread.Sleep(1000000); return 10; }); Thread.Sleep(100); - Assert.AreEqual(10, pool.ThreadCount); + Assert.AreEqual(10, pool.PoolSize); pool.Dispose(); } @@ -149,10 +149,10 @@ [TestMethod] public void WorkerPoolDisposeTest() { var pool = new WorkerPool(5, 20); - Assert.AreEqual(5, pool.ThreadCount); + Assert.AreEqual(5, pool.PoolSize); pool.Dispose(); - Thread.Sleep(100); - Assert.AreEqual(0, pool.ThreadCount); + Thread.Sleep(200); + Assert.AreEqual(0, pool.PoolSize); pool.Dispose(); } @@ -244,7 +244,7 @@ [TestMethod] public void ChainedMapTest() { - using (var pool = new WorkerPool(4,4,0)) { + using (var pool = new WorkerPool(0,100,0)) { int count = 10000; double[] args = new double[count];