Specifies a setup on the mocked type for a call to
to a void method.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 4.0.812.4 (4.0.0.0)
Syntax
| C# |
|---|
public ISetup<T> Setup( Expression<Action<T>> expression ) |
Parameters
- expression
- Type: Expression<(Of <(Action<(Of <(T>)>)>)>)
Lambda expression that specifies the expected method invocation.
Remarks
If more than one setup is specified for the same method or property,
the latest one wins and is the one that will be executed.
Examples
var mock = new Mock<IProcessor>(); mock.Setup(x => x.Execute("ping"));