AtMostOnce Method

Moq 2.6

The expected invocation can happen at most once.

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

Syntax

C#
IVerifies AtMostOnce()

Examples

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

See Also