Skip to content

Commit

Permalink
Fix some SonarCloud issues in UnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed May 4, 2021
1 parent 83d178b commit 8fca1bb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -28,7 +29,7 @@ public void HttpRequestMessageHelper_Create()
}

[Fact]
public async void HttpRequestMessageHelper_Create_Bytes()
public async Task HttpRequestMessageHelper_Create_Bytes()
{
// Assign
var body = new BodyData
Expand All @@ -46,7 +47,7 @@ public async void HttpRequestMessageHelper_Create_Bytes()
}

[Fact]
public async void HttpRequestMessageHelper_Create_Json()
public async Task HttpRequestMessageHelper_Create_Json()
{
// Assign
var body = new BodyData
Expand All @@ -64,7 +65,7 @@ public async void HttpRequestMessageHelper_Create_Json()
}

[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" } } };
Expand All @@ -84,7 +85,7 @@ public async void HttpRequestMessageHelper_Create_Json_With_ContentType_Applicat
}

[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" } } };
Expand Down
4 changes: 2 additions & 2 deletions test/WireMock.Net.Tests/ObservableLogEntriesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()}";
Expand Down Expand Up @@ -48,7 +48,7 @@ public async void WireMockServer_LogEntriesChanged_WithException_Should_LogError
}

[Fact]
public async void WireMockServer_LogEntriesChanged()
public async Task WireMockServer_LogEntriesChanged()
{
// Assign
string path = $"/log_{Guid.NewGuid()}";
Expand Down
12 changes: 6 additions & 6 deletions test/WireMock.Net.Tests/Owin/WireMockMiddlewareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public WireMockMiddlewareTests()
}

[Fact]
public async void WireMockMiddleware_Invoke_NoMatch()
public async Task WireMockMiddleware_Invoke_NoMatch()
{
// Act
await _sut.Invoke(_contextMock.Object);
Expand All @@ -90,7 +90,7 @@ public async void WireMockMiddleware_Invoke_NoMatch()
}

[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[]>());
Expand All @@ -113,7 +113,7 @@ public async void WireMockMiddleware_Invoke_IsAdminInterface_EmptyHeaders_401()
}

[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" } } });
Expand All @@ -136,7 +136,7 @@ public async void WireMockMiddleware_Invoke_IsAdminInterface_MissingHeader_401()
}

[Fact]
public async void WireMockMiddleware_Invoke_RequestLogExpirationDurationIsDefined()
public async Task WireMockMiddleware_Invoke_RequestLogExpirationDurationIsDefined()
{
// Assign
_optionsMock.SetupGet(o => o.RequestLogExpirationDuration).Returns(1);
Expand All @@ -146,7 +146,7 @@ public async void WireMockMiddleware_Invoke_RequestLogExpirationDurationIsDefine
}

[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[]>());
Expand Down Expand Up @@ -195,7 +195,7 @@ public async void WireMockMiddleware_Invoke_Mapping_Has_ProxyAndRecordSettings_A
}

[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[]>());
Expand Down
2 changes: 1 addition & 1 deletion test/WireMock.Net.Tests/WireMockServer.Admin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public void WireMockServer_Admin_AddMappingsAndSaveToFile()
}

[Fact]
public async void WireMockServer_Admin_DeleteMappings()
public async Task WireMockServer_Admin_DeleteMappings()
{
// Arrange
var server = WireMockServer.Start(new WireMockServerSettings
Expand Down

0 comments on commit 8fca1bb

Please sign in to comment.