mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-14 06:17:11 +01:00
Fix some SonarCloud issues in UnitTests (#610)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using NFluent;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WireMock.Http;
|
||||
using WireMock.Models;
|
||||
using WireMock.Types;
|
||||
@@ -28,7 +29,7 @@ namespace WireMock.Net.Tests.Http
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void HttpRequestMessageHelper_Create_Bytes()
|
||||
public async Task HttpRequestMessageHelper_Create_Bytes()
|
||||
{
|
||||
// Assign
|
||||
var body = new BodyData
|
||||
@@ -46,7 +47,7 @@ namespace WireMock.Net.Tests.Http
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void HttpRequestMessageHelper_Create_Json()
|
||||
public async Task HttpRequestMessageHelper_Create_Json()
|
||||
{
|
||||
// Assign
|
||||
var body = new BodyData
|
||||
@@ -64,7 +65,7 @@ namespace WireMock.Net.Tests.Http
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void HttpRequestMessageHelper_Create_Json_With_ContentType_ApplicationJson()
|
||||
public async Task HttpRequestMessageHelper_Create_Json_With_ContentType_ApplicationJson()
|
||||
{
|
||||
// Assign
|
||||
var headers = new Dictionary<string, string[]> { { "Content-Type", new[] { "application/json" } } };
|
||||
@@ -84,7 +85,7 @@ namespace WireMock.Net.Tests.Http
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void HttpRequestMessageHelper_Create_Json_With_ContentType_ApplicationJson_UTF8()
|
||||
public async Task HttpRequestMessageHelper_Create_Json_With_ContentType_ApplicationJson_UTF8()
|
||||
{
|
||||
// Assign
|
||||
var headers = new Dictionary<string, string[]> { { "Content-Type", new[] { "application/json; charset=utf-8" } } };
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace WireMock.Net.Tests
|
||||
public class ObservableLogEntriesTest
|
||||
{
|
||||
[Fact]
|
||||
public async void WireMockServer_LogEntriesChanged_WithException_Should_LogError()
|
||||
public async Task WireMockServer_LogEntriesChanged_WithException_Should_LogError()
|
||||
{
|
||||
// Assign
|
||||
string path = $"/log_{Guid.NewGuid()}";
|
||||
@@ -48,7 +48,7 @@ namespace WireMock.Net.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockServer_LogEntriesChanged()
|
||||
public async Task WireMockServer_LogEntriesChanged()
|
||||
{
|
||||
// Assign
|
||||
string path = $"/log_{Guid.NewGuid()}";
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_NoMatch()
|
||||
public async Task WireMockMiddleware_Invoke_NoMatch()
|
||||
{
|
||||
// Act
|
||||
await _sut.Invoke(_contextMock.Object);
|
||||
@@ -90,7 +90,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_IsAdminInterface_EmptyHeaders_401()
|
||||
public async Task WireMockMiddleware_Invoke_IsAdminInterface_EmptyHeaders_401()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
@@ -113,7 +113,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_IsAdminInterface_MissingHeader_401()
|
||||
public async Task WireMockMiddleware_Invoke_IsAdminInterface_MissingHeader_401()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]> { { "h", new[] { "x" } } });
|
||||
@@ -136,7 +136,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_RequestLogExpirationDurationIsDefined()
|
||||
public async Task WireMockMiddleware_Invoke_RequestLogExpirationDurationIsDefined()
|
||||
{
|
||||
// Assign
|
||||
_optionsMock.SetupGet(o => o.RequestLogExpirationDuration).Returns(1);
|
||||
@@ -146,7 +146,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_Mapping_Has_ProxyAndRecordSettings_And_SaveMapping_Is_True()
|
||||
public async Task WireMockMiddleware_Invoke_Mapping_Has_ProxyAndRecordSettings_And_SaveMapping_Is_True()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
@@ -195,7 +195,7 @@ namespace WireMock.Net.Tests.Owin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockMiddleware_Invoke_Mapping_Has_ProxyAndRecordSettings_And_SaveMapping_Is_False_But_WireMockServerSettings_SaveMapping_Is_True()
|
||||
public async Task WireMockMiddleware_Invoke_Mapping_Has_ProxyAndRecordSettings_And_SaveMapping_Is_False_But_WireMockServerSettings_SaveMapping_Is_True()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary<string, string[]>());
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace WireMock.Net.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void WireMockServer_Admin_DeleteMappings()
|
||||
public async Task WireMockServer_Admin_DeleteMappings()
|
||||
{
|
||||
// Arrange
|
||||
var server = WireMockServer.Start(new WireMockServerSettings
|
||||
|
||||
Reference in New Issue
Block a user