-
Notifications
You must be signed in to change notification settings - Fork 746
NUnit.Framework.Does cannot be extended #2836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting the inconsistency! This was not by design. We should use Would you be interested in contributing a fix with a test ensuring that |
@jnm2 At a glance, the other constraint-generating helper classes ( Or, if you prefer the short form, for this issue, let's just fix what has been reported. 😈 Regarding tests. We wouldn't compile if |
@CharliePoole This is why I was pretty sure that nunit/src/NUnitFramework/framework/Assert.cs Lines 53 to 62 in d411123
Since it already is extensible in the same way, with a comment making the intention explicit, I'm thinking we should just test it at the same time. The benefit I see in tests, versus just adding a protected constructor, is that we are keeping the cross-cutting spec in one place. |
@jnm2 This is an area where we have previously disagreed, so I'm not expecting to convert you. 😸 However, for the sake of discussion, I'll point out that the comment is a carry-over from NUnit V2. The current team has never actually decided that we want people to be able to do this. Such a decision could probably be made with minimal discussion, but I still believe it should happen. We have enough "features" that we never decided to have. I was ready to push a quick PR to fix what @richard-fine asked about when I read your initial comment. I'm not opposing everything you suggested, just saying that a discussion is needed, and we should have it separately so as not to slow things down. I read you as saying that your extensions to the request are so obvious that we shouldn't have to discuss them. That's fine as a first position, but once somebody says "No, I think there's more to discuss here," I believe we should just have the discussion. I think it's reasonable to fix what @richard-fine has pointed out and to make the other constraint-generating classes work the same way in a single PR. Obviously, I think tests are essential. However, I'd prefer to discuss |
You and I are on the same page here! 😃 Did you have a PR close by, or can I put it up for grabs for tests on all the constraint syntax classes? |
I'll submit the PR. |
Charlie, I was so busy thinking of what was important to myself that I failed to listen to your request and your comments in this thread. I dislike this and there's no excuse for it. Would you please forgive me? |
The documentation for custom constraints demonstrates incorporating custom constraints into the fluent syntax like this:
That works fine for NUnit.Framework.Is, but NUnit.Framework.Does is marked as static, and so cannot be extended in the same way.
Given that it serves basically the same role and is only really there to make the assertion read more nicely, I think it should also be extendable, for the exact same reasons that Is is extendable.
The text was updated successfully, but these errors were encountered: