diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -17,3 +17,4 @@ MonoPlay/bin/ MonoPlay/obj/ Implab.Test/Implab.Format.Test/bin/ Implab.Test/Implab.Format.Test/obj/ +*.suo diff --git a/Implab.Test/Implab.Test.csproj b/Implab.Test/Implab.Test.csproj --- a/Implab.Test/Implab.Test.csproj +++ b/Implab.Test/Implab.Test.csproj @@ -62,8 +62,10 @@ + + diff --git a/Implab.Test/RunnableComponentTests.cs b/Implab.Test/RunnableComponentTests.cs --- a/Implab.Test/RunnableComponentTests.cs +++ b/Implab.Test/RunnableComponentTests.cs @@ -9,7 +9,7 @@ using Implab.Components; using NUnit.Framework; using TestClassAttribute = NUnit.Framework.TestFixtureAttribute; using TestMethodAttribute = NUnit.Framework.TestAttribute; - +using AssertFailedException = NUnit.Framework.AssertionException; #else using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -23,8 +23,8 @@ namespace Implab.Test { static void ShouldThrow(Action action) { try { action(); - Assert.Fail(); - } catch(AssertionException) { + Assert.Fail(); + } catch (AssertFailedException) { throw; } catch { } @@ -131,7 +131,8 @@ namespace Implab.Test { p.Cancel(); ShouldThrow(() => p.Join(1000)); Assert.AreEqual(ExecutionState.Failed, comp.State); - Assert.IsInstanceOfType(typeof(OperationCanceledException), comp.LastError); + + Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); comp.Dispose(); } @@ -183,8 +184,8 @@ namespace Implab.Test { Assert.AreEqual(ExecutionState.Stopping, comp.State); p.Cancel(); ShouldThrow(() => p.Join(1000)); - Assert.AreEqual(ExecutionState.Failed, comp.State); - Assert.IsInstanceOfType(typeof(OperationCanceledException), comp.LastError); + Assert.AreEqual(ExecutionState.Failed, comp.State); + Assert.IsInstanceOfType(comp.LastError, typeof(OperationCanceledException)); comp.Dispose(); }