1

Closed

Returning a DU where a DU option is actually required kills the test runner

description

You can see in the solution from this repository how returning a DU from a Mock on an interface that actually returns a DU option causes the test runner to completely give up. It will not run any of the tests in the solution.

I do not think this is really an issue with Foq, just my stupidity; but maybe there is a way to detect whatever it is that is "blowing up", intercept it, and fail the test with a descriptive error message.
Closed Jan 26, 2014 at 6:34 PM by ptrelford

comments

ptrelford wrote Jan 26, 2014 at 5:45 PM

Thanks for the repro. The issue was a typo on the generic constraint for Returns of function.
The API will now correctly give a design time & compile time error for this case.
This fix will be rolled into Foq Release 1.5