I am new to TDD, but used it long enough to understand how to use mocks, stubs, dependency injections, control inversion to solve βsimilarβ problems ... but for some reason I feel very awkward using dependency injection and passing in "IThread" (or similar).
To give it some basic context - I'm trying to add unit tests to an outdated application, and I'm not sure how the unit test class has a constructor that spawns two threads.
The only use case for dependency injection?
If so, what about the functionality that threads bring? As these threads execute during (true) loops, they never exit the loop (unless the application ends). There are reasonable pieces of code inside the loops, and this is the code I really want to experience.
To make things worse, I donβt want to pull all the functions out of loops and into public methods (I only test public methods, since my tests exist in another project), since it will really reduce the ease of using the class elsewhere in the code.
Any suggestions?
c # unit-testing nunit moq
InvertedAcceleration
source share