Setup(TResult) Method (String, Object[])

Moq

Collapse imageExpand ImageCopy imageCopyHover image
Specifies a setup for an invocation on a property or a non void method with the given methodOrPropertyName, optionally specifying arguments for the method call.

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

Syntax

C#
ISetup<TMock, TResult> Setup<TResult>(
	string methodOrPropertyName,
	params Object[] args
)

Parameters

methodOrPropertyName
Type: System..::..String
The name of the method or property to be invoked.
args
Type: array<System..::..Object>[]()[][]
The optional arguments for the invocation. If argument matchers are used, remember to use ItExpr rather than It.

Type Parameters

TResult
The return type of the method or property.

See Also