diff --git a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs index c9b57630..81617761 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs @@ -19,12 +19,12 @@ public void TestReporter() Approvals.Verify("Hello"); } } - catch (Exception e) + catch (AssertionException exception) { var expectedMessage = string.Format(" String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); Assert.AreEqual( expectedMessage, - e.Message); + exception.Message); } } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs index d7f478c2..bfafdb74 100644 --- a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs @@ -21,7 +21,7 @@ public void TestReporter() Approvals.Verify("Hello"); } } - catch (Exception e) + catch (AssertionException e) { var expectedMessage = string.Format(" Assert.That(actual, Is.EqualTo(expected)){0} String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); ClassicAssert.AreEqual(expectedMessage, e.Message);