Class ResultAssertionsAsyncExtensions
Extension methods to enable FluentAssertions on async Result types (Task and ValueTask).
public static class ResultAssertionsAsyncExtensions
- Inheritance
-
ResultAssertionsAsyncExtensions
- Inherited Members
Methods
BeFailureAsync<TValue>(Task<Result<TValue>>, string, params object[])
Asserts that the async result is a failure.
public static Task<AndWhichConstraint<ResultAssertions<TValue>, Error>> BeFailureAsync<TValue>(this Task<Result<TValue>> resultTask, string because = "", params object[] becauseArgs)
Parameters
resultTaskTask<Result<TValue>>The task containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- Task<AndWhichConstraint<ResultAssertions<TValue>, Error>>
An AndWhich constraint for method chaining with the error.
Type Parameters
TValueThe type of the result value.
BeFailureAsync<TValue>(ValueTask<Result<TValue>>, string, params object[])
Asserts that the async ValueTask result is a failure.
public static ValueTask<AndWhichConstraint<ResultAssertions<TValue>, Error>> BeFailureAsync<TValue>(this ValueTask<Result<TValue>> resultTask, string because = "", params object[] becauseArgs)
Parameters
resultTaskValueTask<Result<TValue>>The ValueTask containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- ValueTask<AndWhichConstraint<ResultAssertions<TValue>, Error>>
An AndWhich constraint for method chaining with the error.
Type Parameters
TValueThe type of the result value.
BeFailureOfTypeAsync<TValue, TError>(Task<Result<TValue>>, string, params object[])
Asserts that the async result is a failure of a specific error type.
public static Task<AndWhichConstraint<ResultAssertions<TValue>, TError>> BeFailureOfTypeAsync<TValue, TError>(this Task<Result<TValue>> resultTask, string because = "", params object[] becauseArgs) where TError : Error
Parameters
resultTaskTask<Result<TValue>>The task containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- Task<AndWhichConstraint<ResultAssertions<TValue>, TError>>
An AndWhich constraint for method chaining with the typed error.
Type Parameters
TValueThe type of the result value.
TErrorThe expected error type.
BeFailureOfTypeAsync<TValue, TError>(ValueTask<Result<TValue>>, string, params object[])
Asserts that the async ValueTask result is a failure of a specific error type.
public static ValueTask<AndWhichConstraint<ResultAssertions<TValue>, TError>> BeFailureOfTypeAsync<TValue, TError>(this ValueTask<Result<TValue>> resultTask, string because = "", params object[] becauseArgs) where TError : Error
Parameters
resultTaskValueTask<Result<TValue>>The ValueTask containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- ValueTask<AndWhichConstraint<ResultAssertions<TValue>, TError>>
An AndWhich constraint for method chaining with the typed error.
Type Parameters
TValueThe type of the result value.
TErrorThe expected error type.
BeSuccessAsync<TValue>(Task<Result<TValue>>, string, params object[])
Asserts that the async result is a success.
public static Task<AndWhichConstraint<ResultAssertions<TValue>, TValue>> BeSuccessAsync<TValue>(this Task<Result<TValue>> resultTask, string because = "", params object[] becauseArgs)
Parameters
resultTaskTask<Result<TValue>>The task containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- Task<AndWhichConstraint<ResultAssertions<TValue>, TValue>>
An AndWhich constraint for method chaining with the success value.
Type Parameters
TValueThe type of the result value.
BeSuccessAsync<TValue>(ValueTask<Result<TValue>>, string, params object[])
Asserts that the async ValueTask result is a success.
public static ValueTask<AndWhichConstraint<ResultAssertions<TValue>, TValue>> BeSuccessAsync<TValue>(this ValueTask<Result<TValue>> resultTask, string because = "", params object[] becauseArgs)
Parameters
resultTaskValueTask<Result<TValue>>The ValueTask containing the result.
becausestringA formatted phrase explaining why the assertion is needed.
becauseArgsobject[]Zero or more objects to format using the placeholders.
Returns
- ValueTask<AndWhichConstraint<ResultAssertions<TValue>, TValue>>
An AndWhich constraint for method chaining with the success value.
Type Parameters
TValueThe type of the result value.