1

I have many 'TestClass' in my project. Each TestClass have many 'TestMethod' in them. These test methods are against exchange online. And exchange online allows only 3 runspaces to be created/active at a given point of time.

But MSTest creates multiple threads to execute each 'TestMethod' within a 'TestClass'. Because of this, I wont be able to re-use (reason is exchange online runspace gets broken frequently and if so, I need to create a new one) just 1 runspace and creating single runspace for each test method is not an option.

Is there anyway I can execute 1 test method at a time ? Is there any alternative. Please help. Thanks.

user1576882
  • 147
  • 2
  • 3
  • 13
  • As far as I know, MSTest guarantess that every test is executed one at a time in a sequence (except in Load Test scenarii). What exactly is your problem? – Keysharpener Jan 23 '14 at 17:02

1 Answers1

1

To my knowledge, you can't force MSTest to run tests single threaded but there are ways to achieve what you want.

One possibility would be to create OrderedTest and add all your tests to it. Ordered test runs one test after another.
It could be a lot of work if you have really many tests, though.

For another possibility please check this post: MSTest executing all my tests simultaneously breaks tests - what to do

Community
  • 1
  • 1
Elena
  • 1,928
  • 1
  • 15
  • 23