0

i want to call some function once before all test started, and i need to know which tests are going to run. For example, if i selected TestMethod1 and TestMethod3 in my test plan, and run those two testcases, i need to get the test method information of 'TestMethod1' and 'TestMethod3'.

Is there any way to do that??

Narutokk
  • 964
  • 1
  • 8
  • 20
  • AssemblyInitialize may help - http://stackoverflow.com/questions/2382552/mstest-is-it-possible-to-execute-code-once-before-all-tests-run It provides a TestContext object as parameter, however it won't list all the tests you are running. How are you specifying which tests need to be run to MSTest? – Arun M Dec 30 '13 at 09:30
  • Are you starting your tests using MTM (Microsoft Test Manager)? What exactly do you mean with "I need to get the names" of the tests methods? What do you need these names for? – Elena Dec 30 '13 at 11:55
  • thanks for all your replies. Every testcase is made up several steps, 'setup environment', 'generate configuration', 'do cost-intensive data processing' and 'validate results'. And that would cost several minutes per test. But i want to focus on data validation, so I try to parallelize the steps before validations. To do that, I need to know which tests are going to run dynamicly, whether it's started by vs test plan or resharper test runner. so that I can generate the right configurations and do the right processing – Narutokk Dec 30 '13 at 17:09

0 Answers0