Replies: 1 comment
-
Ok, I found the answer myself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a question about the Verify() invoke count on a moq'ed method and thread safety.
I tried to find some locking mechanism in the moq source but I failed to find any.
Do multiple threads calling a moq'ed method deliver safe invoke counts?
How is that done in code? I was looking and stopped when encountering ILGenerator.Emit() calls :)
Is it a feature delivered by Castle.DynamicProxy?
Is there a need to make a threadsafestub yourself instead of relying on Moq'ed method calls and calling Verify on them?
I understood there is still a thread safety issue when using SetupSequence() but that in general moq is thread safe. Is that correct?
Unless running a test for 24 hours which does not fail (and which is not a proof by itself) I failed to find the evidence in the moq source code.
Edit: Good to mention that we use moq version 4.15.2.
Looking forward to your answer.
Kind regards,
choas75
Beta Was this translation helpful? Give feedback.
All reactions