Skip to content

Detect non-virtual received calls #16

Closed
@tpodolak

Description

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

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions