Verifiable Method (String)

Moq

Collapse image Expand Image Copy image CopyHover image
Marks the expectation as verifiable, meaning that a call to Verify()()()() will check if this particular expectation was met, and specifies a message for failures.

Namespace: Moq.Language
Assembly: Moq (in Moq.dll) Version: 4.0.10827.0 (4.0.0.0)

Syntax

C#
void Verifiable(
	string failMessage
)

Parameters

failMessage
Type: System..::..String

Examples

The following example marks the expectation as verifiable:
CopyC#
mock.Expect(x => x.Execute("ping"))
    .Returns(true)
    .Verifiable("Ping should be executed always!");

See Also