I try to set up a mock using
Mock<Interface>.With(fun y -> <@ y.DoIt (any()) --> async {()} @>)
This leads to a NotSupportedException
being raised in the function toCall
.
How should I mock Async in Foq?
Is it supported?
Short answer: yes Foq supports returning an async block.
Issue is under discussion here: https://foq.codeplex.com/workitem/list/basic
Looks like the exception was raised as the arguments to DoIt were partially applied.