mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-20 16:44:31 +01:00
Add WireMock.Net.AspNetCore.Middleware (#1175)
* Add WireMock.Net.AspNetCore.Middleware * . * WireMock.Net.Middleware.Tests * . * X-WireMock-Response-Delay
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
|
||||
namespace WireMock.Net.Middleware.Tests;
|
||||
|
||||
internal class CustomWebApplicationFactory<TEntryPoint> : WebApplicationFactory<TEntryPoint>
|
||||
where TEntryPoint : class
|
||||
{
|
||||
private readonly List<(string Key, string Value)> _settings = new();
|
||||
|
||||
public CustomWebApplicationFactory(bool alwaysRedirectToWireMock = true)
|
||||
{
|
||||
_settings.Add(("AlwaysRedirectToWireMock", alwaysRedirectToWireMock.ToString().ToLowerInvariant()));
|
||||
}
|
||||
|
||||
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||||
{
|
||||
foreach (var arg in _settings)
|
||||
{
|
||||
builder.UseSetting(arg.Key, arg.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user