-
Notifications
You must be signed in to change notification settings - Fork 264
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
Improve output for expected argument matchers #806
Improve output for expected argument matchers #806
Conversation
957259f
to
e4bdaed
Compare
aa3cd12
to
50401f7
Compare
- Add IDescribeSpecification to allow custom arg matchers to provide custom output for "expected to receive" entries. - Fallback to ToString when IDescribeSpecification not implemented. - Update code comment docs accordingly. Relates to nsubstitute#796.
- use string.Empty for null value from IDescribeSpecification, rather than falling back to ToString(). This supports the contract that IDescribeSpecification will be used if implemented. Replacing null string.Empty with matches the documented behaviour of IDescribeNonMatches. - updated IDescribeSpecification code docs. - removed GenericToNonGenericMatcherProxyWithDescribe `ToString` as it can use the GenericToNonGenericMatcherProxy superclass implementation. - update ArgumentSpecification to also support IDescribeSpecification for its matcher. - Replace linq with Array.ConvertAll rather than requiring an extra ToArray conversion.
50401f7
to
72005d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Small feature, but could be a good quality of life enhancement
One question why do we need |
Yes, I agree it feels like smell. IDK if it is needed, but especially since nullable reference types is enabled in the code and the specified methods are declared to return |
I've merged as-is as the PR is pretty old already, but would be very happy to accept a PR to improve this code. 🙇 |
Closes #796.