[This is preliminary documentation and is subject to change.]

Specifies the value to return.

Namespace:  Moq
Assembly:  Moq (in Moq)
Version: 1.5.2951.38938 (1.5.0.0)

Syntax

C#
void Returns(
	TResult value
)

Parameters

value
Type: TResult
The value to return, or nullNothingnullptra null reference (Nothing in Visual Basic).

Examples

Return a true value from the method call:
CopyC#
mock.Expect(x => x.Execute("ping")).Returns(true);

See Also