diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets
index f4f4b349..a86e5b8f 100644
--- a/test/Directory.Build.targets
+++ b/test/Directory.Build.targets
@@ -13,13 +13,13 @@
-
+
-
+
diff --git a/test/MockHttp.Json.Tests/Extensions/MockHttpRequestContextExtensionsTests.cs b/test/MockHttp.Json.Tests/Extensions/MockHttpRequestContextExtensionsTests.cs
index ce8a6ba4..8d1f0f01 100644
--- a/test/MockHttp.Json.Tests/Extensions/MockHttpRequestContextExtensionsTests.cs
+++ b/test/MockHttp.Json.Tests/Extensions/MockHttpRequestContextExtensionsTests.cs
@@ -26,7 +26,7 @@ public void Given_that_adapter_is_not_registered_when_getting_adapter_it_should_
public void Given_that_adapter_is_registered_when_getting_adapter_it_should_return_same_instance()
{
using var msg = new HttpRequestMessage();
- IJsonAdapter adapter = Mock.Of();
+ IJsonAdapter adapter = Substitute.For();
var items = new Dictionary { { typeof(IJsonAdapter), adapter } };
var sut = new MockHttpRequestContext(msg, items);
sut.Services.Should().NotBeEmpty();
diff --git a/test/MockHttp.Json.Tests/JsonContentMatcherTests.cs b/test/MockHttp.Json.Tests/JsonContentMatcherTests.cs
index bde5fb06..dc1ba740 100644
--- a/test/MockHttp.Json.Tests/JsonContentMatcherTests.cs
+++ b/test/MockHttp.Json.Tests/JsonContentMatcherTests.cs
@@ -4,22 +4,21 @@ namespace MockHttp.Json;
public sealed class JsonContentMatcherTests : IDisposable
{
- private readonly Mock _adapterMock;
- private readonly Mock> _equalityComparerMock;
- private readonly Dictionary _services;
+ private readonly IJsonAdapter _adapterMock;
+ private readonly IEqualityComparer _equalityComparerMock;
+ private readonly Dictionary _services = new();
private readonly HttpRequestMessage _requestMessage;
private readonly MockHttpRequestContext _requestContext;
public JsonContentMatcherTests()
{
- _adapterMock = new Mock();
+ _adapterMock = Substitute.For();
- _equalityComparerMock = new Mock>();
+ _equalityComparerMock = Substitute.For>();
_equalityComparerMock
- .Setup(m => m.Equals(It.IsAny()!, It.IsAny()!))
+ .Equals(Arg.Any(), Arg.Any())
.Returns(true);
- _services = new Dictionary();
_requestMessage = new HttpRequestMessage();
_requestContext = new MockHttpRequestContext(_requestMessage, _services);
}
@@ -30,25 +29,21 @@ public async Task Given_that_adapter_is_provided_to_ctor_when_matching_it_should
var jsonContentAsObject = new { PropertyName = "value" };
const string serializedJson = "{\"modifiedPropertyName\":\"modifiedValue\"}";
_adapterMock
- .Setup(m => m.Serialize(jsonContentAsObject))
- .Returns(serializedJson)
- .Verifiable();
+ .Serialize(Arg.Any