Search code examples
c#testingdeploymentitem

Changing the name of a DeploymentItem


I am using DeploymentItems to deploy test files. I was wondering if it was possible to change the name of the deployed file in the deployed location instead of just doing a copy. For example:

[DeploymentItem("path/to/my/file/test.txt", "testfiles/somethingelse.txt")]

It would deploy test.txt but it would rename the file to somethingelse.txt.

Or do I just have to do this manually using the File I/O API before I run my actual test?


Solution

  • It appears that this is not possible. One must copy files manually during test setup.