Closed stakx closed 2 weeks 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.
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.
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.
protected
,)protected internal
,internal
static
members(requires targeting .NET 7 or newer & a major architectural expansion to include non-instance members; let's do this in a future PR)static abstract
membersTesting 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.