Mercurial > pub > ImplabNet
comparison Implab.Test/RunnableComponentTests.cs @ 194:d45bdf510514 v2
working on diagnostics
author | cin |
---|---|
date | Mon, 25 Apr 2016 15:18:56 +0300 |
parents | 3071220371f8 |
children | 4d9830a9bbb8 |
comparison
equal
deleted
inserted
replaced
191:cc19dc78edb7 | 194:d45bdf510514 |
---|---|
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 } |