Closed KennethHoff closed 6 days ago
Thanks for the bug report and repro - very useful.
I found this on nsub: https://github.com/nsubstitute/NSubstitute/issues/766
In particular, this entry that says it's a bug in nsub: https://github.com/nsubstitute/NSubstitute/issues/766#issuecomment-1882436897
I don't know much about how nsub works, but I use it a fair bit and it's very useful. If I get time, I'll take a look to see if I can contribute the suggested fix in that thread.
But for now, I'll close this as it's not a bug in Vogen. I'l have a think of a workaround and let you know if I come up with anything.
Thanks again for the feedback!
Describe the bug
If you try to mock methods containing struct-based ValueObjects using the
NSubstitute
library,NSubstitute
throws an exception. Class-based ValueObjects work.Exception for the
StructString_ArgAny
test in the Repro:dotnet --info
:Steps to reproduce
Repro: https://github.com/KennethHoff/Repros/tree/master/VogenNsubstitute
Vogen
version: 5.0.5NSubstitute
version: 5.3.0.Net
version: 8.0.11 && 9.0.0Expected behaviour
class
andstruct
ValueObjects should both work as type parameters forArg.Any<{TYPE}>
andArg.Is<{TYPE}>
.