mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 10:49:19 +02:00
Version 2.x (#1359)
* Version 2.x * Setup .NET 9 * 12 * cleanup some #if for NETSTANDARD1_3 * cleanup + fix tests for net8 * openapi * NO ConfigureAwait(false) + cleanup * . * #endif * HashSet * WireMock.Net.NUnit * HttpContext * Add WebSockets (#1423) * Add WebSockets * Add tests * fix * more tests * Add tests * ... * remove IOwin * - * tests * fluent * ok * match * . * byte[] * x * func * func * byte * trans * ... * frameworks......... * jmes * xxx * sc * using var httpClient = new HttpClient(); * usings * maxRetries * up * xunit v3 * ct * --- * ct * ct2 * T Unit * WireMock.Net.TUnitTests / 10 * t unit first * --project * no tunit * t2 * --project * --project * ci - --project * publish ./test/wiremock-coverage.xml * windows * . * log * ... * log * goed * BodyType * . * . * --scenario * ... * pact * ct * . * WireMock.Net.RestClient.AwesomeAssertions (#1427) * WireMock.Net.RestClient.AwesomeAssertions * ok * atpath * fix test * sonar fixes * ports * proxy test * FIX? * --- * await Task.Delay(100, _ct); * ? * --project * Aspire: use IDistributedApplicationEventingSubscriber (#1428) * broadcast * ok * more tsts * . * Collection * up * . * 2 * remove nfluent * <VersionPrefix>2.0.0-preview-02</VersionPrefix> * ... * . * nuget icon * . * <PackageReference Include="JmesPath.Net" Version="1.1.0" /> * x * 500 * . * fix some warnings * ws
This commit is contained in:
@@ -1,49 +1,31 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
using WireMock.Models;
|
||||
using WireMock.Owin;
|
||||
using WireMock.Owin.Mappers;
|
||||
using WireMock.Util;
|
||||
using WireMock.Logging;
|
||||
using WireMock.Matchers;
|
||||
using System.Collections.Generic;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Diagnostics;
|
||||
#endif
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Admin.Requests;
|
||||
using WireMock.Settings;
|
||||
using FluentAssertions;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Logging;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.RequestBuilders;
|
||||
#if NET6_0_OR_GREATER
|
||||
using WireMock.Models;
|
||||
using WireMock.Owin;
|
||||
using WireMock.Owin.ActivityTracing;
|
||||
#endif
|
||||
#if NET452
|
||||
using Microsoft.Owin;
|
||||
using IContext = Microsoft.Owin.IOwinContext;
|
||||
using IRequest = Microsoft.Owin.IOwinRequest;
|
||||
using IResponse = Microsoft.Owin.IOwinResponse;
|
||||
#else
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using IContext = Microsoft.AspNetCore.Http.HttpContext;
|
||||
using IRequest = Microsoft.AspNetCore.Http.HttpRequest;
|
||||
using IResponse = Microsoft.AspNetCore.Http.HttpResponse;
|
||||
#endif
|
||||
using WireMock.Owin.Mappers;
|
||||
using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Util;
|
||||
|
||||
namespace WireMock.Net.Tests.Owin;
|
||||
|
||||
public class WireMockMiddlewareTests
|
||||
{
|
||||
private static readonly Guid NewGuid = new("98fae52e-76df-47d9-876f-2ee32e931d9b");
|
||||
private static readonly DateTime UtcNow = new(2026, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
private static readonly DateTime UpdatedAt = new(2022, 12, 4);
|
||||
|
||||
private readonly ConcurrentDictionary<Guid, IMapping> _mappings = new();
|
||||
@@ -53,14 +35,21 @@ public class WireMockMiddlewareTests
|
||||
private readonly Mock<IMappingMatcher> _matcherMock;
|
||||
private readonly Mock<IMapping> _mappingMock;
|
||||
private readonly Mock<IRequestMatchResult> _requestMatchResultMock;
|
||||
private readonly Mock<IContext> _contextMock;
|
||||
private readonly Mock<HttpContext> _contextMock;
|
||||
private readonly Mock<IGuidUtils> _guidUtilsMock;
|
||||
private readonly Mock<IDateTimeUtils> _dateTimeUtilsMock;
|
||||
|
||||
private readonly WireMockMiddleware _sut;
|
||||
|
||||
public WireMockMiddlewareTests()
|
||||
{
|
||||
var guidUtilsMock = new Mock<IGuidUtils>();
|
||||
guidUtilsMock.Setup(g => g.NewGuid()).Returns(NewGuid);
|
||||
var wireMockMiddlewareLoggerMock = new Mock<IWireMockMiddlewareLogger>();
|
||||
|
||||
_guidUtilsMock = new Mock<IGuidUtils>();
|
||||
_guidUtilsMock.Setup(g => g.NewGuid()).Returns(NewGuid);
|
||||
|
||||
_dateTimeUtilsMock = new Mock<IDateTimeUtils>();
|
||||
_dateTimeUtilsMock.Setup(d => d.UtcNow).Returns(UtcNow);
|
||||
|
||||
_optionsMock = new Mock<IWireMockMiddlewareOptions>();
|
||||
_optionsMock.SetupAllProperties();
|
||||
@@ -74,31 +63,34 @@ public class WireMockMiddlewareTests
|
||||
_requestMapperMock = new Mock<IOwinRequestMapper>();
|
||||
_requestMapperMock.SetupAllProperties();
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1");
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_responseMapperMock = new Mock<IOwinResponseMapper>();
|
||||
_responseMapperMock.SetupAllProperties();
|
||||
_responseMapperMock.Setup(m => m.MapAsync(It.IsAny<ResponseMessage?>(), It.IsAny<IResponse>())).Returns(Task.FromResult(true));
|
||||
_responseMapperMock.Setup(m => m.MapAsync(It.IsAny<ResponseMessage?>(), It.IsAny<HttpResponse>())).Returns(Task.FromResult(true));
|
||||
|
||||
_matcherMock = new Mock<IMappingMatcher>();
|
||||
_matcherMock.SetupAllProperties();
|
||||
// _matcherMock.Setup(m => m.FindBestMatch(It.IsAny<RequestMessage>())).Returns((new MappingMatcherResult(), new MappingMatcherResult()));
|
||||
|
||||
_contextMock = new Mock<IContext>();
|
||||
_contextMock = new Mock<HttpContext>();
|
||||
_contextMock.SetupGet(c => c.Items).Returns(new Dictionary<object, object?>());
|
||||
|
||||
_mappingMock = new Mock<IMapping>();
|
||||
|
||||
_requestMatchResultMock = new Mock<IRequestMatchResult>();
|
||||
_requestMatchResultMock.Setup(r => r.TotalNumber).Returns(1);
|
||||
_requestMatchResultMock.Setup(r => r.MatchDetails).Returns(new List<MatchDetail>());
|
||||
_requestMatchResultMock.Setup(r => r.MatchDetails).Returns([]);
|
||||
|
||||
_sut = new WireMockMiddleware(
|
||||
null,
|
||||
_ => Task.CompletedTask,
|
||||
_optionsMock.Object,
|
||||
_requestMapperMock.Object,
|
||||
_responseMapperMock.Object,
|
||||
_matcherMock.Object,
|
||||
guidUtilsMock.Object
|
||||
wireMockMiddlewareLoggerMock.Object,
|
||||
_guidUtilsMock.Object,
|
||||
_dateTimeUtilsMock.Object
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,35 +98,13 @@ public class WireMockMiddlewareTests
|
||||
public async Task WireMockMiddleware_Invoke_NoMatch()
|
||||
{
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert and Verify
|
||||
_optionsMock.Verify(o => o.Logger.Warn(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
|
||||
|
||||
Expression<Func<ResponseMessage, bool>> match = r => (int)r.StatusCode! == 404 && ((StatusModel)r.BodyData!.BodyAsJson!).Status == "No matching mapping found";
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WireMockMiddleware_Invoke_NoMatch_When_SaveUnmatchedRequestsIsTrue_Should_Call_LocalFileSystemHandler_WriteUnmatchedRequest()
|
||||
{
|
||||
// Arrange
|
||||
var fileSystemHandlerMock = new Mock<IFileSystemHandler>();
|
||||
_optionsMock.Setup(o => o.FileSystemHandler).Returns(fileSystemHandlerMock.Object);
|
||||
_optionsMock.Setup(o => o.SaveUnmatchedRequests).Returns(true);
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
_optionsMock.Verify(o => o.Logger.Warn(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
|
||||
|
||||
Expression<Func<ResponseMessage, bool>> match = r => (int)r.StatusCode! == 404 && ((StatusModel)r.BodyData!.BodyAsJson!).Status == "No matching mapping found";
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
|
||||
|
||||
// Verify
|
||||
fileSystemHandlerMock.Verify(f => f.WriteUnmatchedRequest("98fae52e-76df-47d9-876f-2ee32e931d9b.LogEntry.json", It.IsAny<string>()));
|
||||
fileSystemHandlerMock.VerifyNoOtherCalls();
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<HttpResponse>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -142,7 +112,7 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher());
|
||||
_mappingMock.SetupGet(m => m.IsAdminInterface).Returns(true);
|
||||
@@ -151,13 +121,13 @@ public class WireMockMiddlewareTests
|
||||
_matcherMock.Setup(m => m.FindBestMatch(It.IsAny<RequestMessage>())).Returns((result, result));
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert and Verify
|
||||
_optionsMock.Verify(o => o.Logger.Error(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
|
||||
|
||||
Expression<Func<ResponseMessage, bool>> match = r => (int?)r.StatusCode == 401;
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<HttpResponse>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -165,7 +135,7 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]> { { "h", new[] { "x" } } });
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher());
|
||||
_mappingMock.SetupGet(m => m.IsAdminInterface).Returns(true);
|
||||
@@ -174,13 +144,13 @@ public class WireMockMiddlewareTests
|
||||
_matcherMock.Setup(m => m.FindBestMatch(It.IsAny<RequestMessage>())).Returns((result, result));
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert and Verify
|
||||
_optionsMock.Verify(o => o.Logger.Error(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
|
||||
|
||||
Expression<Func<ResponseMessage, bool>> match = r => (int?)r.StatusCode == 401;
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
|
||||
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<HttpResponse>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -190,7 +160,7 @@ public class WireMockMiddlewareTests
|
||||
_optionsMock.SetupGet(o => o.RequestLogExpirationDuration).Returns(1);
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -198,7 +168,7 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher());
|
||||
|
||||
@@ -225,7 +195,7 @@ public class WireMockMiddlewareTests
|
||||
_mappingMock.SetupGet(m => m.Settings).Returns(settings);
|
||||
|
||||
var newMappingFromProxy = new Mapping(NewGuid, UpdatedAt, string.Empty, string.Empty, null, settings, Request.Create(), Response.Create(), 0, null, null, null, null, null, false, null, null);
|
||||
_mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny<RequestMessage>())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy));
|
||||
_mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny<HttpContext>(), It.IsAny<RequestMessage>())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy));
|
||||
|
||||
var requestBuilder = Request.Create().UsingAnyMethod();
|
||||
_mappingMock.SetupGet(m => m.RequestMatcher).Returns(requestBuilder);
|
||||
@@ -234,7 +204,7 @@ public class WireMockMiddlewareTests
|
||||
_matcherMock.Setup(m => m.FindBestMatch(It.IsAny<RequestMessage>())).Returns((result, result));
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert and Verify
|
||||
fileSystemHandlerMock.Verify(f => f.WriteMappingFile(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
@@ -247,7 +217,7 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher());
|
||||
|
||||
@@ -279,16 +249,16 @@ public class WireMockMiddlewareTests
|
||||
_mappingMock.SetupGet(m => m.Settings).Returns(settings);
|
||||
|
||||
var newMappingFromProxy = new Mapping(NewGuid, UpdatedAt, "my-title", "my-description", null, settings, Request.Create(), Response.Create(), 0, null, null, null, null, null, false, null, data: null);
|
||||
_mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny<RequestMessage>())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy));
|
||||
_mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny<HttpContext>(), It.IsAny<RequestMessage>())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy));
|
||||
|
||||
var requestBuilder = Request.Create().UsingAnyMethod();
|
||||
_mappingMock.SetupGet(m => m.RequestMatcher).Returns(requestBuilder);
|
||||
|
||||
var result = new MappingMatcherResult (_mappingMock.Object, _requestMatchResultMock.Object);
|
||||
var result = new MappingMatcherResult(_mappingMock.Object, _requestMatchResultMock.Object);
|
||||
_matcherMock.Setup(m => m.FindBestMatch(It.IsAny<RequestMessage>())).Returns((result, result));
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert and Verify
|
||||
fileSystemHandlerMock.Verify(f => f.WriteMappingFile(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
@@ -296,15 +266,14 @@ public class WireMockMiddlewareTests
|
||||
_mappings.Should().HaveCount(1);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[Fact]
|
||||
public async Task WireMockMiddleware_Invoke_AdminPath_WithExcludeAdminRequests_ShouldNotStartActivity()
|
||||
{
|
||||
// Arrange
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/__admin/health"), "GET", "::1");
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new WireMock.Owin.ActivityTracing.ActivityTracingOptions
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new ActivityTracingOptions
|
||||
{
|
||||
ExcludeAdminRequests = true
|
||||
});
|
||||
@@ -320,7 +289,7 @@ public class WireMockMiddlewareTests
|
||||
ActivitySource.AddActivityListener(listener);
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert
|
||||
activityStarted.Should().BeFalse();
|
||||
@@ -331,9 +300,9 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Arrange
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/api/orders"), "GET", "::1");
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new WireMock.Owin.ActivityTracing.ActivityTracingOptions
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new ActivityTracingOptions
|
||||
{
|
||||
ExcludeAdminRequests = true
|
||||
});
|
||||
@@ -349,7 +318,7 @@ public class WireMockMiddlewareTests
|
||||
ActivitySource.AddActivityListener(listener);
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert
|
||||
activityStarted.Should().BeTrue();
|
||||
@@ -360,9 +329,9 @@ public class WireMockMiddlewareTests
|
||||
{
|
||||
// Arrange
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/api/orders"), "GET", "::1");
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<IRequest>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
_requestMapperMock.Setup(m => m.MapAsync(It.IsAny<HttpContext>(), It.IsAny<IWireMockMiddlewareOptions>())).ReturnsAsync(request);
|
||||
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns((WireMock.Owin.ActivityTracing.ActivityTracingOptions?)null);
|
||||
_optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns((ActivityTracingOptions?)null);
|
||||
|
||||
var activityStarted = false;
|
||||
using var listener = new ActivityListener
|
||||
@@ -375,10 +344,9 @@ public class WireMockMiddlewareTests
|
||||
ActivitySource.AddActivityListener(listener);
|
||||
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object).ConfigureAwait(false);
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
|
||||
// Assert
|
||||
activityStarted.Should().BeFalse();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user