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