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

NS1004 when using Arg.Do() #159

Closed
rcdailey opened this issue Apr 25, 2021 · 1 comment · Fixed by #169
Closed

NS1004 when using Arg.Do() #159

rcdailey opened this issue Apr 25, 2021 · 1 comment · Fixed by #169
Labels
bug Something isn't working
Milestone

Comments

@rcdailey
Copy link

I'm honestly not sure if this is a false positive or not. What I can tell you is that my test is behaving as I expect.

Here' the relevant lines:

            var provider = Substitute.For<IConfigurationProvider<SonarrConfiguration>>();
            var actualActiveConfigs = new List<SonarrConfiguration>();
            provider.ActiveConfiguration = Arg.Do<SonarrConfiguration>(a => actualActiveConfigs.Add(a)); <-- NS1004

Using Jetbrains Rider, I get this:
image

My repo is open source so you can easily see the issue in real time here if you want:

https://github.com/rcdailey/trash-updater/blob/7604397/src/Trash.Tests/Config/ConfigurationLoaderTest.cs#L96

I'm not sure why it's getting tripped up. provider is itself an interface. It uses a generic parameter that is not an interface; maybe that's confusing it?

@tpodolak
Copy link
Member

Hi @rcdailey, thanks for reporting. Looks like a bug to me. I might have missed the case that Arg.Do can be used with properties. I will try to investigate when I can

@tpodolak tpodolak added the bug Something isn't working label Apr 25, 2021
tpodolak added a commit that referenced this issue Sep 4, 2021
tpodolak added a commit that referenced this issue Sep 4, 2021
tpodolak added a commit that referenced this issue Sep 5, 2021
tpodolak added a commit that referenced this issue Nov 11, 2021
@tpodolak tpodolak added this to the 1.0.15 milestone Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants