Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature: allow interception of any generic method call when using Arg.AnyType - #855

#855
Merged
dtchepak merged 1 commit into
nsubstitute:mainnsubstitute/NSubstitute:mainfrom
JMolenkamp:mainCopy head branch name to clipboard
Mar 23, 2025
Merged

Feature: allow interception of any generic method call when using Arg.AnyType#855
dtchepak merged 1 commit into
nsubstitute:mainnsubstitute/NSubstitute:mainfrom
JMolenkamp:mainCopy head branch name to clipboard

Conversation

@JMolenkamp

Copy link
Copy Markdown
Contributor

Allow for interception of any call to a generic method, regardless of used generic argument.
Related to issue 854

@dtchepak

Copy link
Copy Markdown
Member

Hi @JMolenkamp ,

Thanks a lot for this. Could you please add tests to this PR to demonstrate the change?

@JMolenkamp

JMolenkamp commented Jan 28, 2025

Copy link
Copy Markdown
Contributor Author

Added some tests. The first two fail without the change. The last one does not build without the change.

Maybe this PR needs to be split into two. Part of it is a fix for the first two tests, which should not fail, I think?
The other part is adding a MethodInfo property to CallInfo, allowing for something like the third test, which is similar to the use case that led me to make this PR.

@JMolenkamp

Copy link
Copy Markdown
Contributor Author

Moved the fixes from this PR to #862. This PR now only contains the feature request.
It is dependent upon #862 though, the test for demonstration purposes will fail without it.

@dtchepak dtchepak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!
Merged in dependent PR. I think needs a rebase now.

Comment thread tests/NSubstitute.Acceptance.Specs/GenericArguments.cs Outdated
@dtchepak
dtchepak self-requested a review March 23, 2025 05:18
@dtchepak
dtchepak merged commit 05ed0a7 into nsubstitute:main Mar 23, 2025
This was referenced Jul 12, 2026
This was referenced Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.