-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Description
Description
It would be great to use WithMessage() on ThrowAsync<>().
Complete minimal example reproducing the issue
// Arrange
Func<Task> act = () => throw new InvalidOperationException("Hello World");
// Act & Assert
await act().Should().ThrowAsync<InvalidOperationException>().WithMessage("HelloWorld");Actual behavior:
Compile-time error. If have to await/block the Task to use WithMessage() (e. g. await act().Should().ThrowAsync<InvalidOperationException>().Result.WithMessage("HelloWorld");).
Versions
5.6.0
Metadata
Metadata
Assignees
Labels
No labels