Mercurial > pub > ImplabNet
diff Implab.Test/AsyncTests.cs @ 105:4d308952fd5e v2
minor fixes
author | cin |
---|---|
date | Mon, 10 Nov 2014 10:17:54 +0300 |
parents | 2c5631b43c7d |
children | d4e38929ce36 |
line wrap: on
line diff
--- a/Implab.Test/AsyncTests.cs Sun Nov 09 23:03:45 2014 +0300 +++ b/Implab.Test/AsyncTests.cs Mon Nov 10 10:17:54 2014 +0300 @@ -139,6 +139,21 @@ } [TestMethod] + public void ChainFailTest() { + var p1 = new Promise<int>(); + + var p3 = p1.Chain(x => { + var p2 = new Promise<string>(); + p2.Reject(new Exception("DIE!!!")); + return p2; + }); + + p1.Resolve(100); + + Assert.IsTrue(p3.IsResolved); + } + + [TestMethod] public void PoolTest() { var pid = Thread.CurrentThread.ManagedThreadId; var p = AsyncPool.Invoke(() => Thread.CurrentThread.ManagedThreadId);