Remove usage of `async void` in unit tests
Yes I know xUnit supports it, but it's non-standard and it shouldn't show up anywhere in our codebase.
This commit is contained in:
parent
230a13d0e1
commit
ef29749e72
|
|
@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async void ExecuteValueMethodAsync()
|
||||
public async Task ExecuteValueMethodAsync()
|
||||
{
|
||||
var executor = GetExecutorForMethod("ValueMethodAsync");
|
||||
var result = await executor.ExecuteAsync(
|
||||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async void ExecuteValueMethodWithReturnTypeAsync()
|
||||
public async Task ExecuteValueMethodWithReturnTypeAsync()
|
||||
{
|
||||
var executor = GetExecutorForMethod("ValueMethodWithReturnTypeAsync");
|
||||
var result = await executor.ExecuteAsync(
|
||||
|
|
@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async void ExecuteValueMethodUpdateValueAsync()
|
||||
public async Task ExecuteValueMethodUpdateValueAsync()
|
||||
{
|
||||
var executor = GetExecutorForMethod("ValueMethodUpdateValueAsync");
|
||||
var parameter = new TestObject();
|
||||
|
|
@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async void ExecuteValueMethodWithReturnTypeThrowsExceptionAsync()
|
||||
public async Task ExecuteValueMethodWithReturnTypeThrowsExceptionAsync()
|
||||
{
|
||||
var executor = GetExecutorForMethod("ValueMethodWithReturnTypeThrowsExceptionAsync");
|
||||
var parameter = new TestObject();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
public class RedirectToActionResultTest
|
||||
{
|
||||
[Fact]
|
||||
public async void RedirectToAction_Execute_PassesCorrectValuesToRedirect()
|
||||
public async Task RedirectToAction_Execute_PassesCorrectValuesToRedirect()
|
||||
{
|
||||
// Arrange
|
||||
var expectedUrl = "SampleAction";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
{
|
||||
[Theory]
|
||||
[MemberData(nameof(RedirectToRouteData))]
|
||||
public async void RedirectToRoute_Execute_PassesCorrectValuesToRedirect(object values)
|
||||
public async Task RedirectToRoute_Execute_PassesCorrectValuesToRedirect(object values)
|
||||
{
|
||||
// Arrange
|
||||
var expectedUrl = "SampleAction";
|
||||
|
|
|
|||
Loading…
Reference in New Issue