Skip to content

Major refactor of subclasses of ReferenceTypeAssertions, especially delegate-related ones#1067

Merged
dennisdoomen merged 15 commits intofluentassertions:masterfrom
davidomid:issue#1066
Jun 1, 2019
Merged

Major refactor of subclasses of ReferenceTypeAssertions, especially delegate-related ones#1067
dennisdoomen merged 15 commits intofluentassertions:masterfrom
davidomid:issue#1066

Conversation

@davidomid
Copy link
Copy Markdown
Contributor

@davidomid davidomid commented May 31, 2019

Fixes #1066

A new abstract DelegateAssertions class was added which takes a delegate type as generic type parameter. It's inherited by ActionAssertions, FunctionAssertions and AsyncFunctionAssertions.

This was done to greatly reduce the amount of duplicate code which was introduced by re-implementing the same methods in each of those subclasses. There were also issues where there were inconsistencies between the error messages and XML summaries of the duplicated methods. It also added a lot of overhead for a developer as we had to add implementations of new methods several times.

The duplicate methods were:

  • Throw
  • NotThrow
  • Throw
  • NotThrow
  • NotThrowAfter
  • ThrowExactly

@davidomid
Copy link
Copy Markdown
Contributor Author

@dennisdoomen @jnyrup

If these changes look good to you, I would highly recommend approving and merging this PR sooner rather than later, as the changes affect 31 files and conflicts might become problematic later on.

Only tests failing are the flaky ones.

Thanks very much :)

Copy link
Copy Markdown
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimming through the changes, it looks good.
But I always get worried about breaking changes.

Copy link
Copy Markdown
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice cleanup!

@jnyrup jnyrup requested a review from dennisdoomen May 31, 2019 16:53
@davidomid
Copy link
Copy Markdown
Contributor Author

This is a really nice cleanup!

Thanks :) Thanks for the thorough code review 👍

@dennisdoomen dennisdoomen merged commit c0b2ba3 into fluentassertions:master Jun 1, 2019
@dennisdoomen
Copy link
Copy Markdown
Member

Can you update the description to explain the big picture. It helps me use this in the release notes.

@davidomid
Copy link
Copy Markdown
Contributor Author

Can you update the description to explain the big picture. It helps me use this in the release notes.

Done 👍

Let me know if it's detailed enough.

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.

Most of ActionAssertions, FunctionAssertions and AsyncFunctionAssertions is duplicated

3 participants