@@ -17,3 +17,4 MonoPlay/bin/ | |||
|
17 | 17 | MonoPlay/obj/ |
|
18 | 18 | Implab.Test/Implab.Format.Test/bin/ |
|
19 | 19 | Implab.Test/Implab.Format.Test/obj/ |
|
20 | *.suo |
@@ -62,8 +62,10 | |||
|
62 | 62 | </ItemGroup> |
|
63 | 63 | <ItemGroup> |
|
64 | 64 | <Compile Include="AsyncTests.cs" /> |
|
65 | <Compile Include="CancelationTests.cs" /> | |
|
65 | 66 | <Compile Include="PromiseHelper.cs" /> |
|
66 | 67 | <Compile Include="Properties\AssemblyInfo.cs" /> |
|
68 | <Compile Include="RunnableComponentTests.cs" /> | |
|
67 | 69 | </ItemGroup> |
|
68 | 70 | <ItemGroup> |
|
69 | 71 | <ProjectReference Include="..\Implab\Implab.csproj"> |
@@ -9,7 +9,7 using Implab.Components; | |||
|
9 | 9 | using NUnit.Framework; |
|
10 | 10 | using TestClassAttribute = NUnit.Framework.TestFixtureAttribute; |
|
11 | 11 | using TestMethodAttribute = NUnit.Framework.TestAttribute; |
|
12 | ||
|
12 | using AssertFailedException = NUnit.Framework.AssertionException; | |
|
13 | 13 | #else |
|
14 | 14 | |
|
15 | 15 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
@@ -23,8 +23,8 namespace Implab.Test { | |||
|
23 | 23 | static void ShouldThrow(Action action) { |
|
24 | 24 | try { |
|
25 | 25 | action(); |
|
26 | Assert.Fail(); | |
|
27 |
} catch(Assert |
|
|
26 | Assert.Fail(); | |
|
27 | } catch (AssertFailedException) { | |
|
28 | 28 | throw; |
|
29 | 29 | } catch { |
|
30 | 30 | } |
@@ -131,7 +131,8 namespace Implab.Test { | |||
|
131 | 131 | p.Cancel(); |
|
132 | 132 | ShouldThrow(() => p.Join(1000)); |
|
133 | 133 | Assert.AreEqual(ExecutionState.Failed, comp.State); |
|
134 | Assert.IsInstanceOfType(typeof(OperationCanceledException), comp.LastError); | |
|
134 | ||
|
135 | Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); | |
|
135 | 136 | |
|
136 | 137 | comp.Dispose(); |
|
137 | 138 | } |
@@ -183,8 +184,8 namespace Implab.Test { | |||
|
183 | 184 | Assert.AreEqual(ExecutionState.Stopping, comp.State); |
|
184 | 185 | p.Cancel(); |
|
185 | 186 | ShouldThrow(() => p.Join(1000)); |
|
186 | Assert.AreEqual(ExecutionState.Failed, comp.State); | |
|
187 |
Assert.IsInstanceOfType(typeof(OperationCanceledException) |
|
|
187 | Assert.AreEqual(ExecutionState.Failed, comp.State); | |
|
188 | Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); | |
|
188 | 189 | |
|
189 | 190 | comp.Dispose(); |
|
190 | 191 | } |
General Comments 0
You need to be logged in to leave comments.
Login now