❔ Capture parameter value with Moq decorated with the 'in' keyword
Hello!
I'm writing Unit Tests for a library with a lot of structs, which utilizes the
in
keyword to avoid unnecessary copies.
The Moq library allows you to capture passed values to methods.
For example
I've found solutions for capturing ref
and out
parameters. But nothing for in
. I tried solving this some time ago, and only just now thought of asking here, so I do not have more fresh examples.2 Replies
Assume we have the following class we want to mock, and capture parameters passed to it:
And again, the
XMLMessage
and XMLMessageMetadata
are readonly struct
sLooks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.