castleproject / Core

Castle Core, including Castle DynamicProxy, Logging Services and DictionaryAdapter
http://www.castleproject.org/
Other
2.2k stars 467 forks source link

Add support for default interface members in inheritance-based proxy types #661

Closed stakx closed 2 weeks ago

stakx commented 1 year ago

This is another step towards completing #447. I'm limiting this PR to inheritance-based proxy types (i. e. those without target) due to time constraints – having to adjust only 2 out of 5 implementations is a lot less work! – and because these are likely the most important proxy types for downstream testing libraries such as Moq, NSubstitute, etc.

Testing all possible combinations of these aspects would be prohibitive, I've therefore restricted tests to a subset of these combinations that seemed reasonable and justifiable by the nature of the actual code changes / extensions made to DynamicProxy.

stakx commented 1 year ago

@jonorossi, I think I've finally got this in a reasonably understandable & mergable state. I'd appreciate if you could give this at least a cursory review, if you can spare some time.

As noted in the initial description above, this is only for proxies without targets, and I am not testing all possible combinations of DynamicProxy features. Do let me know if you think I have missed any crucial test cases.

Regarding the structure of this PR: most of the commits consist simply of new tests (usually grouped by some aspect listed in the PR's description). Most of those actually pass right away, without any code changes. In the few cases where tests don't pass, the test-only commit is immediately followed by one that makes them succeed. Those actual-code-change commits are sometimes followed by a little refactoring & clean-up work.

stakx commented 2 weeks ago

I think I've let this sit for long enough. (My bad!) I looked over the code again with a fresh set of eyes, this should still be good to go.