Search code examples
c#unit-testingdeploymentmstest

How to avoid DeploymentItem? I need to deploy a file at once for all tests


I want to deploy a file from a single place in code, I don't want to decorate many tests by the same attribute with the same parameter.

I use mstest.


Solution

  • You can decorate the test class with [DeploymentItem] attribute so you do not need to do it for each single tests.

    Alternative you could use Deployment page of .testsettings file, see How to: Deploy Files for Tests