Previous editions of the test framework used a .testsettings
file to manage advance test settings such as deploying test data along with your tests. However, in 2012 Microsoft introduced a newer version of the test framework and mostly did away with the .testsettings
files. You can still use them, but if you do, your tests will be run under the old unit test framework (and thus execute more slowly; also, the older test framework does not allow tests from third-party frameworks).
The recommended solution is to use the default configuration of your unit tests whenever possible. If you need to use test configuration files, you can add them to your project from the Test menu (Test, Test Settings, Select Test Settings File). You can then set the Copy to Output property for those settings files. You can also use DeploymentItemAttribute
on a method you want to use to make your deployments. There are also many setup and teardown attributes you can use to configure your tests. (See the next section, “The Unit Testing Framework.”)
Note
Visual Studio 2015 allows you to use .runsettings
to configure things like code coverage (Enterprise only) analysis and deployment directories. For more information on how to use these advanced settings files, search MSDN for “Specifying Test Settings for Visual Studio Tests.”