Mocking Framework Integration #2020
-
I am looking through TUnit and noticed the part about awaiting assertions. If I need to mock dependencies for a unit test, I am currently using NSubstitute to mock those dependencies. Does TUnit support mocking dependencies natively? If not, when using NSubstitute's built-in way of asserting dependency calls, those are not async so will this cause issues with TUnit needing assertions to be awaited? [Test] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Tunit doesn't natively mock. And it only requires awaiting TUnit specific assertions, because the await keyword actually performs the execution. Nsubstitute can still have it's synchronous calls and will work fine |
Beta Was this translation helpful? Give feedback.
Tunit doesn't natively mock. And it only requires awaiting TUnit specific assertions, because the await keyword actually performs the execution.
Nsubstitute can still have it's synchronous calls and will work fine