mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 10:01:00 +01:00
Use try-catch when adding or removing logEntry (#848)
* Use try-catch when removing logEntry * . * try catch add * Add extra check * ...
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using Newtonsoft.Json;
|
||||
using NFluent;
|
||||
@@ -374,6 +375,26 @@ public class WireMockServerAdminTests
|
||||
server.Stop();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WireMockServer_Admin_Logging_SetMaxRequestLogCount_To_0_Should_Not_AddLogging()
|
||||
{
|
||||
// Assign
|
||||
var client = new HttpClient();
|
||||
|
||||
// Act
|
||||
var server = WireMockServer.Start();
|
||||
server.SetMaxRequestLogCount(0);
|
||||
|
||||
await client.GetAsync("http://localhost:" + server.Port + "/foo1").ConfigureAwait(false);
|
||||
await client.GetAsync("http://localhost:" + server.Port + "/foo2").ConfigureAwait(false);
|
||||
await client.GetAsync("http://localhost:" + server.Port + "/foo3").ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
server.LogEntries.Should().BeEmpty();
|
||||
|
||||
server.Stop();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WireMockServer_Admin_WatchStaticMappings()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user