Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some SonarCloud issues in UnitTests #610

Merged
merged 1 commit into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("https://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("https://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("https://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("https://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