Skip to content
This repository was archived by the owner on Nov 19, 2017. It is now read-only.

Commit 91b6fc6

Browse files
committed
Fix net 1.1 and netcf 2.0 builds, broken by prior fix
1 parent 46dbe8f commit 91b6fc6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/testdata/ExpectedExceptionData.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ public void AlternateExceptionHandler(Exception ex)
277277
}
278278
}
279279

280+
#if CLR_2_0 || CLR_4_0
280281
public static class StaticClassWithExpectedExceptions
281282
{
282283
[Test, ExpectedException(typeof(ArgumentException))]
@@ -296,4 +297,5 @@ public static void TestFailsInStaticClass_WrongExceptionThrown()
296297
throw new InvalidOperationException("wrong exception");
297298
}
298299
}
300+
#endif
299301
}

src/tests/Attributes/ExpectedExceptionTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,25 +444,27 @@ public void TestIsNotRunnableWhenAlternateHandlerIsNotFound()
444444
test.Properties.Get(PropertyNames.SkipReason) );
445445
}
446446

447+
#if CLR_2_0 || CLR_4_0
447448
[Test]
448449
public void TestSucceedsInStaticClass()
449450
{
450-
var result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestSucceedsInStaticClass");
451+
ITestResult result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestSucceedsInStaticClass");
451452
Assert.That(result.ResultState, Is.EqualTo(ResultState.Success));
452453
}
453454

454455
[Test]
455456
public void TestFailsInStaticClass_NoExceptionThrown()
456457
{
457-
var result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestFailsInStaticClass_NoExceptionThrown");
458+
ITestResult result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestFailsInStaticClass_NoExceptionThrown");
458459
Assert.That(result.ResultState, Is.EqualTo(ResultState.Failure));
459460
}
460461

461462
[Test]
462463
public void TestFailsInStaticClass_WrongExceptionThrown()
463464
{
464-
var result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestFailsInStaticClass_WrongExceptionThrown");
465+
ITestResult result = TestBuilder.RunTestCase(typeof(StaticClassWithExpectedExceptions), "TestFailsInStaticClass_WrongExceptionThrown");
465466
Assert.That(result.ResultState, Is.EqualTo(ResultState.Failure));
466467
}
467-
}
468+
#endif
469+
}
468470
}

0 commit comments

Comments
 (0)