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

Return Task for async/non-async test method #1736

Merged
merged 1 commit into from Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions Tests/FluentAssertions.Specs/Types/MethodInfoSelectorSpecs.cs
Expand Up @@ -284,7 +284,7 @@ public void When_selecting_methods_that_are_async_it_should_only_return_the_appl

// Assert
methods.Should().ContainSingle()
.Which.Name.Should().Be("PublicVoidAsyncMethod");
.Which.Name.Should().Be("PublicAsyncMethod");
}

[Fact]
Expand All @@ -298,7 +298,7 @@ public void When_selecting_methods_that_are_not_async_it_should_only_return_the_

// Assert
methods.Should().ContainSingle()
.Which.Name.Should().Be("PublicVoidNotAsyncMethod");
.Which.Name.Should().Be("PublicNonAsyncMethod");
}

[Fact]
Expand Down Expand Up @@ -398,12 +398,9 @@ internal class TestClassForMethodSelectorWithNonInheritableAttributeDerived : Te

internal class TestClassForMethodSelectorWithAsyncAndNonAsyncMethod
{
public async void PublicVoidAsyncMethod()
{
await Task.Yield();
}
public async Task PublicAsyncMethod() => await Task.Yield();

public void PublicVoidNotAsyncMethod() { }
public Task PublicNonAsyncMethod() => Task.CompletedTask;
}

internal class TestClassForMethodReturnTypesSelector
Expand Down