Sets an expectation on the mocked type for a call to
to a void method.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 2.5.1.153 (2.5.1.0)
Syntax
| C# |
|---|
IExpect Expect( Expression<Action<T>> expression ) |
Parameters
- expression
- Type: System.Linq.Expressions..::.Expression<(Of <(Action<(Of <(T>)>)>)>)
Lambda expression that specifies the expected method invocation.
Remarks
If more than one expectation is set 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.Expect(x => x.Execute("ping"));