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

Detect non-virtual received calls #16

Closed
tpodolak opened this issue Jun 28, 2018 · 1 comment
Closed

Detect non-virtual received calls #16

tpodolak opened this issue Jun 28, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tpodolak
Copy link
Member

Analyzers should be able to detect following wrong usages

namespace MyNamespace
{
    public class Foo
    {
        public int Bar()
        {
            return 2;
        }
    }

    public class FooTests
    {
        public void Test()
        {
            var substitute = NSubstitute.Substitute.For<Foo>();
            substitute.Received().Bar();
            substitute.ReceivedWithAnyArgs().Bar()
            substitute.DidNotReceive().Bar();
            substitute.DidNotReceiveWithAnyArgs().Bar();
        }
    }
}

and of course usages of beforementioned examples executed as ordinal method

@tpodolak
Copy link
Member Author

Closed by #17

@tpodolak tpodolak added this to the 0.1.0-beta2 milestone Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant