We are mocking Visual Studio SDK API which involves a lot of calls with byref arguments (both in and out). Using
isn't enough since there might be multiple overloads, and these calls might be in a C# project. We tried
let documentFactoryService =
.Calls<ITextBuffer * byref<ITextDocument>>(fun (textBuffer, textDocument) ->
but F# compiler doesn't like byref arguments inside quotations (see
for a few examples).
Sometimes I'm able to use SetUpByName
and return tuples, but Foq code generation crashes NUnit test runners.
We have a few examples involving byref arguments e.g.
so that you know what usage we are looking for. We would love to be able to replace these handwritten object expressions by Foq calls. Their uses are