changeset 73:3b8393be3441 v2

fixed tests
author cin
date Fri, 05 Sep 2014 00:27:14 +0400
parents d67b95eddaf4
children c4140283575c
files Implab.Test/AsyncTests.cs Implab.Test/PromiseHelper.cs
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Implab.Test/AsyncTests.cs	Thu Sep 04 18:47:12 2014 +0400
+++ b/Implab.Test/AsyncTests.cs	Fri Sep 05 00:27:14 2014 +0400
@@ -23,7 +23,13 @@
             Exception err = null;
 
             var p = new Promise<int>();
-            p.Then(x => res = x, e => err = e);
+            p.Then(
+                x => res = x,
+                e => {
+                    err = e;
+                    return -2;
+                }
+            );
             p.Reject(new ApplicationException("error"));
 
             Assert.AreEqual(res, -1);
@@ -354,7 +360,7 @@
         [TestMethod]
         public void ChainedCancel2Test() {
             // при отмене цепочки обещаний, вложенные операции также должны отменяться
-            IPromiseBase p = null;
+            IPromise p = null;
             var pSurvive = new Promise<bool>();
             var hemStarted = new ManualResetEvent(false);
             p = PromiseHelper
--- a/Implab.Test/PromiseHelper.cs	Thu Sep 04 18:47:12 2014 +0400
+++ b/Implab.Test/PromiseHelper.cs	Fri Sep 05 00:27:14 2014 +0400
@@ -7,7 +7,7 @@
 
 namespace Implab.Test {
     class PromiseHelper {
-        public static Promise<T> Sleep<T>(int timeout, T retVal) {
+        public static IPromise<T> Sleep<T>(int timeout, T retVal) {
             return AsyncPool.Invoke(() => {
                 Thread.Sleep(timeout);
                 return retVal;