//
//
-#if NET_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
namespace MonoTests.System.Threading.Tasks
{
} catch (InvalidOperationException) {
}
- Assert.IsTrue (task.IsCanceled, "#2");
-
- task = factory.StartNew (() => 1, ct);
try {
task.Wait ();
+ Assert.Fail ("#2");
} catch (AggregateException e) {
- Assert.IsTrue (task.IsCanceled, "#3");
- Assert.That (e.InnerException, Is.TypeOf (typeof (TaskCanceledException)), "#4");
+ Assert.That (e.InnerException, Is.TypeOf (typeof (TaskCanceledException)), "#3");
}
+
+ Assert.IsTrue (task.IsCanceled, "#4");
}
}
}
-#endif