From 9bfae15f32b62ec5a3beca8ad1c0848e48bfaa37 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 3 May 2026 11:33:07 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- test/WireMock.Net.Tests/Matchers/SystemTextJsonMatcherTests.cs | 3 ++- .../Matchers/SystemTextJsonPartialWildcardMatcherTests.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/WireMock.Net.Tests/Matchers/SystemTextJsonMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/SystemTextJsonMatcherTests.cs index cbc7ba73..6a97284a 100644 --- a/test/WireMock.Net.Tests/Matchers/SystemTextJsonMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/SystemTextJsonMatcherTests.cs @@ -68,9 +68,10 @@ public class SystemTextJsonMatcherTests { // Assign var matcher = new SystemTextJsonMatcher("{}"); + using var stream = new MemoryStream(); // Act - var result = matcher.IsMatch(new MemoryStream()); + var result = matcher.IsMatch(stream); // Assert result.Score.Should().Be(MatchScores.Mismatch); diff --git a/test/WireMock.Net.Tests/Matchers/SystemTextJsonPartialWildcardMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/SystemTextJsonPartialWildcardMatcherTests.cs index f5d936a7..057a9ecd 100644 --- a/test/WireMock.Net.Tests/Matchers/SystemTextJsonPartialWildcardMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/SystemTextJsonPartialWildcardMatcherTests.cs @@ -60,7 +60,8 @@ public class SystemTextJsonPartialWildcardMatcherTests var matcher = new SystemTextJsonPartialWildcardMatcher("{}"); // Act - var result = matcher.IsMatch(new MemoryStream()); + using var stream = new MemoryStream(); + var result = matcher.IsMatch(stream); // Assert result.Score.Should().Be(MatchScores.Mismatch);