В моем проекте Unit-test я создал папку TestFile, в этой папке есть несколько файлов. , скажем, a.txt, b.txt.
Теперь в моем классе модульного теста я добавил атрибут DeploymentItem. Но файл не копируется.
Вот мой код.
Код: Выделить всё
[TestClass]
[DeploymentItem("TestFile")]
public class CustomLibraryTest
{
public TestContext TestContext { get; set; }
[TestMethod]
[DeploymentItem(@"TestFiles\a.txt")] // THis should deploy a.txt to test deployment directory
{
var path = TestContext.TestDeploymentDir + "a.txt";
// Now when I debug this unit-test, and open path in explorer,
// a.txt is not present in "TestResults\Deploy_fhafeez 2013-05-28 13_02_37\Out" folder
}
}
Подробнее здесь: https://stackoverflow.com/questions/167 ... ying-files