Skip to content
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

how to mock ReadOnlySpan param? #326

Open
ali50m opened this issue Jul 29, 2024 · 0 comments
Open

how to mock ReadOnlySpan param? #326

ali50m opened this issue Jul 29, 2024 · 0 comments

Comments

@ali50m
Copy link

ali50m commented Jul 29, 2024

I have a generic method like below,

public interface IItemsIndexFetchService
{
    T GetItemByIndex<T>(ReadOnlySpan<T> items, int index);
}

But I have no idea about how to mock the ReadOnlySpan parameter for this method. Could you helpl me out? Thanks!

 _mocker
    .GetMock<IItemsIndexFetchService>()
    .Setup(x => x.GetItemByIndex(It.IsAny<[HOW]>(), It.IsAny<int>()))
    .Returns( [HOW] );
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

No branches or pull requests

1 participant