Specifies the value to return.
Namespace:
Moq.LanguageAssembly: Moq (in Moq.dll) Version: 2.6.1121.2 (2.6.0.0)
Syntax
| C# |
|---|
IReturnsResult 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);