mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-20 15:31:33 +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:
1 parent
c57590b2ba
commit
42306d1864
23 files changed
+641
-1
No files matched your search
@@ -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