From 27a6ff9d5a9eee04f8bf697ef06f10bbb9d007b1 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 18:48:34 +1000 Subject: [PATCH] . --- src/ApprovalTests.NUnit3/NUnitReporterTest.cs | 4 ++-- src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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);