Delegates
Last updated
Last updated
Moq can be used to create fake delegates. Mocks faking delegates can be configured like normal methods to , or .
The snippets below are based on the following type
Moq can fake explicit delegates by simply passing their type to the constructor.
Alternatively, Moq supports delegates based on Func
and Action
.
It is possible to configure the delegates as if they were normal methods.
Finally, Moq can generate for delegates too.