Mercurial > pub > ImplabNet
comparison Implab.Test/RunnableComponentTests.cs @ 196:40d7fed4a09e
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.
author | cin |
---|---|
date | Mon, 29 Aug 2016 23:15:51 +0300 |
parents | 3071220371f8 |
children | 4d9830a9bbb8 |
comparison
equal
deleted
inserted
replaced
193:0d69c0d6de0d | 196:40d7fed4a09e |
---|---|
130 Assert.AreEqual(ExecutionState.Starting, comp.State); | 130 Assert.AreEqual(ExecutionState.Starting, comp.State); |
131 p.Cancel(); | 131 p.Cancel(); |
132 ShouldThrow(() => p.Join(1000)); | 132 ShouldThrow(() => p.Join(1000)); |
133 Assert.AreEqual(ExecutionState.Failed, comp.State); | 133 Assert.AreEqual(ExecutionState.Failed, comp.State); |
134 | 134 |
135 Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); | 135 Assert.IsTrue(comp.LastError is OperationCanceledException); |
136 | 136 |
137 comp.Dispose(); | 137 comp.Dispose(); |
138 } | 138 } |
139 | 139 |
140 [TestMethod] | 140 [TestMethod] |
183 var p = comp.Stop(); | 183 var p = comp.Stop(); |
184 Assert.AreEqual(ExecutionState.Stopping, comp.State); | 184 Assert.AreEqual(ExecutionState.Stopping, comp.State); |
185 p.Cancel(); | 185 p.Cancel(); |
186 ShouldThrow(() => p.Join(1000)); | 186 ShouldThrow(() => p.Join(1000)); |
187 Assert.AreEqual(ExecutionState.Failed, comp.State); | 187 Assert.AreEqual(ExecutionState.Failed, comp.State); |
188 Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); | 188 Assert.IsTrue(comp.LastError is OperationCanceledException); |
189 | 189 |
190 comp.Dispose(); | 190 comp.Dispose(); |
191 } | 191 } |
192 | 192 |
193 } | 193 } |