I need to copy some directories/files for MS Unit test, and I have this code.
[TestInitialize()]
[DeploymentItem("\\library", "library")]
public void Initialize()
{
....
}
The problem is that the directory/files are not copied with [TestInitialize()], I needed to use as follows:
[TestMethod]
[DeploymentItem("\\library", "library")]
public void AddInt16()
{
...
}
Am I supposed to use DeploymentItem only with [TestMethod]? If not, what’s wrong with my code?
You can use it at a method or class level:
so, a good workaround given that its not picked up by
TestInitializeis to move theDeploymentItemto your class.