Returns Method (TProperty)

Moq 2.6

Specifies the value to return.

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

Syntax

C#
IReturnsResult Returns(
	TProperty value
)

Parameters

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

Examples

Return a true value from the property getter call:
CopyC#
mock.ExpectGet(x => x.Suspended)
    .Returns(true);

See Also