Question

We have a testing environment using Visual Studio 2013 and MSTest where we need to run a setup script (.cmd-file) before starting certain test runs. Currently we are using .testsettings files for this purpose, which works great.

However a problem arose when we started using MS Fakes and shims, because debugging tests using the ShimsContext throws a UnitTestIsolationException with the error message Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables.

The way to resolve this appears to be to change to a .runsettings file instead, to use the Visual Studio testrunner instead of MSTest. But how can we specify a setup script to be run once before the entire test run using this file format?

Was it helpful?

Solution

You can call your *.cmd scripts from initialize and cleanup methods.

Check this: How to create Startup and Cleanup script for Visual Studio Test Project?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top