diff Implab.Test/RunnableComponentTests.cs @ 188:3071220371f8 ref20160224

Updated VS project
author cin
date Fri, 22 Apr 2016 12:59:31 +0300
parents 822aab37b107
children d45bdf510514
line wrap: on
line diff
--- a/Implab.Test/RunnableComponentTests.cs	Tue Apr 19 17:35:20 2016 +0300
+++ b/Implab.Test/RunnableComponentTests.cs	Fri Apr 22 12:59:31 2016 +0300
@@ -9,7 +9,7 @@
 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 @@
         static void ShouldThrow(Action action) {
             try {
                 action();
-                Assert.Fail();
-            } catch(AssertionException) {
+                Assert.Fail();
+            } catch (AssertFailedException) {
                 throw;
             } catch {
             }
@@ -131,7 +131,8 @@
             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 @@
             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();
         }