Never Method

Moq 2.6

The expected invocation is never expected to happen.

Namespace:  Moq.Language
Assembly:  Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)

Syntax

C#
void Never()

Remarks

Never()()() is always verified inmediately as the invocations are performed, like strict mocks do with unexpected invocations.

Examples

CopyC#
var mock = new Mock<ICommand>();
mock.Expect(foo => foo.Execute("ping"))
    .Never();

See Also