Skip to content

Conversation

@vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Oct 12, 2024

From #871:
Refactor the delegate assertions as follows:

  • Add the following methods to the IDelegateSource<TActual> interface:
    • .ThrowsNothing() (no exception is thrown)
    • .ThrowsException() (any exception is thrown)
    • .Throws<TException>() (an exception of type TException or any subtype is thrown)
    • .ThrowsExactly<TException>() (an exception of type TException is thrown)
  • For all thrown exceptions we have
    • .WithMessage(string) (checks that the message is equal)
    • .WithMessageMatching(string) (checks that the message matches the (wildcard) pattern)
    • .WithInnerException() which allows checks on the inner exception

@vbreuss vbreuss force-pushed the topic/improve-throw branch from 0a3b0c1 to f9f052d Compare October 12, 2024 12:37
@vbreuss vbreuss marked this pull request as ready for review October 12, 2024 12:39
@thomhurst thomhurst merged commit 11f53b3 into thomhurst:main Oct 12, 2024
@vbreuss vbreuss deleted the topic/improve-throw branch October 12, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants