Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -30,21 +30,21 @@ namespace MonoTests.System.Diagnostics.Contracts {
/// Contract.Assert(false) will cause an assert to be triggered with the correct message.
/// </summary>
[Test]
[Ignore ("This causes NUnit crash on .NET 4.0")]
// [Ignore ("This causes NUnit crash on .NET 4.0")]
public void TestAssertNoEventHandler ()
{
try {
Contract.Assert (false);
Assert.Fail ("TestAssertNoEventHandler() exception not thrown #1");
} catch (Exception ex) {
Assert.IsInstanceOfType (typeof (NotImplementedException), ex, "TestAssertNoEventHandler() wrong exception type #1");
Assert.AreEqual ("Assertion failed.", ex.Message);
}
try {
Contract.Assert (false, "Message");
Assert.Fail ("TestAssertNoEventHandler() exception not thrown #2");
} catch (Exception ex) {
Assert.IsInstanceOfType (typeof (NotImplementedException), ex, "TestAssertNoEventHandler() wrong exception type #2");
Assert.AreEqual ("Assertion failed. Message", ex.Message);
}
}
@@ -54,7 +54,7 @@ namespace MonoTests.System.Diagnostics.Contracts {
/// Because nothing is done in the event handler, an assert should be triggered.
/// </summary>
[Test]
[Ignore ("This causes NUnit crash on .NET 4.0")]
// [Ignore ("This causes NUnit crash on .NET 4.0")]
public void TestAssertEventHandlerNoAction ()
{
bool visitedEventHandler = false;
@@ -70,7 +70,7 @@ namespace MonoTests.System.Diagnostics.Contracts {
Contract.Assert (false);
Assert.Fail ("TestAssertEventHandlerNoAction() exception not thrown");
} catch (Exception ex) {
Assert.IsInstanceOfType (typeof (NotImplementedException), ex, "TestAssertEventHandlerNoAction() wrong exception type");
Assert.AreEqual ("Assertion failed.", ex.Message);
}
Assert.IsTrue (visitedEventHandler, "TestAssertEventHandlerNoAction() handler not visited");