I need to generate some performance testing using MSTest (LoadTests) and Visual Studio 2010. I need to make a test of a restful service and gather metrics.
I have created an integration test that request one URL (something restful like http://hostname/get/201212
or whatever is the ID). Later I create a loadtest and manage to execute the integration test thousands of times and investigate response time and server metrics (CPU Load, Memory, etc.)
Now I need to perform a similar scenario but each test need to have a different ID read from a given XML that contains thousands. The idea is not having anything cached.
What I have tried/thought so far?
- The "bubble-sort" solution is create thousands of tests, each one with one id. Not feasible
- The next approach is create one test that read xml, iterate through it and make request. The problem of this approach is that I will end having a big test that takes minutes to run.
- I have a possible workaround using [ClassInitialize] to load all IDs from XML and [TestInitialiaze] to change a global variable each test execution...
I am not sure if the last option is the best one. Is there any mechanism in MSTests to allow me to perform LoadTests using different IDs read from a XML?