Major refactor of subclasses of ReferenceTypeAssertions, especially delegate-related ones#1067
Conversation
…undant implementations
…ndant implementations
…ect initialisations for ReferenceTypeAssertions subclasses
|
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 :) |
jnyrup
left a comment
There was a problem hiding this comment.
Skimming through the changes, it looks good.
But I always get worried about breaking changes.
…dded unit test to enforce this
…llectionAssertionSpecs, added unit tests
jnyrup
left a comment
There was a problem hiding this comment.
This is a really nice cleanup!
Thanks :) Thanks for the thorough code review 👍 |
|
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. |
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: