mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 01:04:55 +01:00
* ProtoBuf
* .
* x
* ---
* x
* fx
* ...
* sc
* ...
* .
* groen
* x
* fix tests
* ok!?
* fix tests
* fix tests
* !
* x
* 6
* .
* x
* ivaluematcher
* transformer
* .
* sc
* .
* mapping
* x
* tra
* com
* ...
* .
* .
* .
* AddProtoDefinition
* .
* set
* grpahj
* .
* .
* IdOrText
* ...
* async
* async2
* .
* t
* nuget
* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0-preview-04" />
* http version
* tests
* .WithHttpVersion("2")
* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0" />
* HttpVersionParser
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Threading.Tasks;
|
|
using Moq;
|
|
using NFluent;
|
|
using WireMock.Owin;
|
|
using WireMock.Owin.Mappers;
|
|
using Xunit;
|
|
#if NET452
|
|
using IContext = Microsoft.Owin.IOwinContext;
|
|
using IResponse = Microsoft.Owin.IOwinResponse;
|
|
#else
|
|
using IContext = Microsoft.AspNetCore.Http.HttpContext;
|
|
using IResponse = Microsoft.AspNetCore.Http.HttpResponse;
|
|
#endif
|
|
|
|
namespace WireMock.Net.Tests.Owin
|
|
{
|
|
public class GlobalExceptionMiddlewareTests
|
|
{
|
|
private readonly Mock<IWireMockMiddlewareOptions> _optionsMock;
|
|
private readonly Mock<IOwinResponseMapper> _responseMapperMock;
|
|
|
|
private readonly GlobalExceptionMiddleware _sut;
|
|
|
|
public GlobalExceptionMiddlewareTests()
|
|
{
|
|
_optionsMock = new Mock<IWireMockMiddlewareOptions>();
|
|
_optionsMock.SetupAllProperties();
|
|
|
|
_responseMapperMock = new Mock<IOwinResponseMapper>();
|
|
_responseMapperMock.SetupAllProperties();
|
|
_responseMapperMock.Setup(m => m.MapAsync(It.IsAny<ResponseMessage?>(), It.IsAny<IResponse>())).Returns(Task.FromResult(true));
|
|
|
|
_sut = new GlobalExceptionMiddleware(null, _optionsMock.Object, _responseMapperMock.Object);
|
|
}
|
|
|
|
[Fact]
|
|
public void GlobalExceptionMiddleware_Invoke_NullAsNext_DoesNotInvokeNextAndDoesNotThrow()
|
|
{
|
|
// Act
|
|
Check.ThatAsyncCode(() => _sut.Invoke(null)).DoesNotThrow();
|
|
}
|
|
}
|
|
} |