Skip to content

Commit

Permalink
introduced AsyncActionAssertions and AsyncFunctionAssertions<T> to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Grützmacher committed Mar 12, 2019
1 parent 38ab041 commit 6aa2939
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 17 deletions.
12 changes: 9 additions & 3 deletions Src/FluentAssertions/AssertionExtensions.Actions.cs
Expand Up @@ -28,7 +28,9 @@ public static partial class AssertionExtensions
/// <returns>
/// Returns an object that allows asserting additional members of the thrown exception.
/// </returns>
public static ExceptionAssertions<TException> ThrowExactly<TException>(this ActionAssertions actionAssertions, string because = "",
public static ExceptionAssertions<TException> ThrowExactly<TException>(
this ActionAssertions actionAssertions,
string because = "",
params object[] becauseArgs)
where TException : Exception
{
Expand All @@ -54,7 +56,9 @@ public static partial class AssertionExtensions
/// <returns>
/// Returns an object that allows asserting additional members of the thrown exception.
/// </returns>
public static ExceptionAssertions<TException> ThrowExactly<TException>(this AsyncFunctionAssertions asyncActionAssertions, string because = "",
public static ExceptionAssertions<TException> ThrowExactly<TException>(
this AsyncActionAssertions asyncActionAssertions,
string because = "",
params object[] becauseArgs)
where TException : Exception
{
Expand All @@ -80,7 +84,9 @@ public static partial class AssertionExtensions
/// <returns>
/// Returns an object that allows asserting additional members of the thrown exception.
/// </returns>
public static async Task<ExceptionAssertions<TException>> ThrowExactlyAsync<TException>(this AsyncFunctionAssertions asyncActionAssertions, string because = "",
public static async Task<ExceptionAssertions<TException>> ThrowExactlyAsync<TException>(
this AsyncActionAssertions asyncActionAssertions,
string because = "",
params object[] becauseArgs)
where TException : Exception
{
Expand Down
8 changes: 4 additions & 4 deletions Src/FluentAssertions/AssertionExtensions.cs
Expand Up @@ -637,19 +637,19 @@ public static ActionAssertions Should(this Action action)
/// current <see cref="System.Func{Task}"/> .
/// </summary>
[Pure]
public static AsyncFunctionAssertions Should(this Func<Task> action)
public static AsyncActionAssertions Should(this Func<Task> action)
{
return new AsyncFunctionAssertions(action, extractor);
return new AsyncActionAssertions(action, extractor);
}

/// <summary>
/// Returns a <see cref="AsyncFunctionAssertions"/> object that can be used to assert the
/// current <see><cref>System.Func{Task{T}}</cref></see>.
/// </summary>
[Pure]
public static AsyncFunctionAssertions Should<T>(this Func<Task<T>> action)
public static AsyncFunctionAssertions<T> Should<T>(this Func<Task<T>> action)
{
return new AsyncFunctionAssertions(action, extractor);
return new AsyncFunctionAssertions<T>(action, extractor);
}

/// <summary>
Expand Down

0 comments on commit 6aa2939

Please sign in to comment.