Skip to content

Match any values for ref parameters using It.Ref<TValue>.IsAny / ItExpr.Ref<TValue>.IsAny#537

Merged
stakx merged 5 commits into
devlooped:developfrom
stakx:itrefisany
Nov 29, 2017
Merged

Match any values for ref parameters using It.Ref<TValue>.IsAny / ItExpr.Ref<TValue>.IsAny#537
stakx merged 5 commits into
devlooped:developfrom
stakx:itrefisany

Conversation

@stakx

@stakx stakx commented Nov 29, 2017

Copy link
Copy Markdown
Contributor

This PR adds It.Ref<T>.IsAny which is to ref parameters what It.IsAny<T>() is to regular by-value parameters:

interface IFoo
{
    void Do(ref int n);
}

var mock = new Mock<IFoo>();
mock.Setup(m => m.Do(ref It.Ref<int>.IsAny));

This resolves #479.

@stakx stakx changed the title Match any values for ref parameters using It.Ref<T>.IsAny Match any values for ref parameters using It.Ref<TValue>.IsAny / ItExpr.Ref<TValue>.IsAny Nov 29, 2017
@stakx stakx merged commit 9225ed6 into devlooped:develop Nov 29, 2017
@stakx stakx deleted the itrefisany branch November 29, 2017 18:02
@devlooped devlooped locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant