mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-16 13:51:04 +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:
1 parent
ef5f988786
commit
38634ac65a
2 files changed
+54
-7
No files matched your search
@@ -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