Clean-up tests related to exceptions by dennisdoomen · Pull Request #3099 · fluentassertions/fluentassertions · GitHub
Skip to content

Clean-up tests related to exceptions#3099

Merged
dennisdoomen merged 1 commit into
fluentassertions:mainfrom
dennisdoomen:cleanup-exception-tests
Sep 20, 2025
Merged

Clean-up tests related to exceptions#3099
dennisdoomen merged 1 commit into
fluentassertions:mainfrom
dennisdoomen:cleanup-exception-tests

Conversation

@dennisdoomen

Copy link
Copy Markdown
Member

This PR cleans up the test code by removing unnecessary helper classes and simplifying test patterns. The main changes involved removing the Does abstract class and its implementations (DoesThrow and DoesNotThrow) that were used to create mock test subjects. Instead, the tests now use simple Action and Func<int> delegates directly with lambda expressions like () => throw new Exception() or () => { }. This eliminates the need for the .Invoking(x => x.Do()) pattern and makes the test assertions more direct and readable. Additionally, some test helper classes like SomeTestClass, ExceptionWithProperties, and ExceptionWithEmptyToString were moved to more appropriate locations within the test files.

@coveralls

coveralls commented Sep 20, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 20, 2025

Copy link
Copy Markdown

@dennisdoomen dennisdoomen force-pushed the cleanup-exception-tests branch from 30a2acf to 97f8fe8 Compare September 20, 2025 15:50
@dennisdoomen dennisdoomen merged commit c84625d into fluentassertions:main Sep 20, 2025
8 checks passed
@dennisdoomen dennisdoomen deleted the cleanup-exception-tests branch September 20, 2025 16:58
This was referenced Sep 25, 2025
This was referenced Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Testing of Fluent Assertion itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants