Does each Class containing tests run in it's own thread? Or does each individual test run in it's own thread? If each Class containing tests has its own thread, are these run concurrently? ie, would tests from class A run concurrently with tests from Class B? Or would class A's tests run (each on their own thread), followed by tests from Class B (each on their own thread)?
相关问题
- Resharper 7 on VS2012 ignores assembly redirect in
- Export test results from Test Explorer visual stud
- Gallio error : MSTest executable was not found
- mocking a method using Moq framework doesn't r
- Unit testing features missing for .NET Core in VS
相关文章
- Log4Net Multiple Projects
- Attribute filter syntax for code coverage in TeamC
- How to replace Middleware in integration tests pro
- How to run ClassCleanup (MSTest) after each class
- Couldn't run tests after updating TestFramewor
- Unit Testing WPF Application with siteoforigin pac
- MSTest TestMethod Dependency Injection
- What is the replacement for TestContext.DataRow[“M
No. All tests run on the same thread
No. All tests run on the same thread.
If you are creating your threads. You are owning the concurrency model for them. The vstest executor does not run your concurrently. There is no guarantee on the sequence in which tests are executed, be it from within a given testclass or the sequence between different testclasses.
Also note that if your unit tests are thread safe, you do have the option to apply threading and have the tests execute in parallel. See this blog post from Microsoft.
Well it seems it does not apply threading at all! I built a test project that contains 3 unit tests, just outputting info to a file using Nlog.
What I found interesting is that the TestClass is constructed once for EACH test. I thought each class would only be constructed ONCE.
Also, the Class Cleanups run at the end of all the tests. I thought each class's cleanup would run after the last test for that class was done.
And finally, they are all run on the same thread! Now that is unexpected. In today's world of multi cores ( my rig has 4), I would have expected to see more threads in the picture.
Each test looks like this:
This is the output...