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:
Ryan Nowak 2016-05-20 15:07:48 -07:00
parent 230a13d0e1
commit ef29749e72
3 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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";

View File

@ -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";