Does anyone have any advice for a consistent way to unit test a multithreaded application? I have done one application where our mock ‘worker threads’ had a thread.sleep with a time that was specified by a public member variable. We would use this so we could set how long a particular thread would take to complete its work, then we could do our assertions. Any ideas of a better way to do this? Any good mock frameworks for .Net that can handle this?
Share
My advice would be not to rely on unit tests to detect concurrency issues for several reasons: