deploymentitem

Is it Possible to have Dynamic - On-The-Fly DeploymentItems?

I want to write tests to check the existance (and other stuff) of certain files that will be shipped with our project. This is what I have right now: [DeploymentItem("1.pdf")] [DeploymentItem("2.pdf")] public class DoFilesExist { List<string> _Files; public DoFilesExist() { _Files = new List<string>(); ...

DeploymentItem Attribute causes all tests in test class to fail with error "Unable to create instance of class [TestClass]"

Hi Everyone. I'm getting a strange error when I try to run a set of unit tests where the class has a DeploymentItem attribute. The unit testing solution has 2 test classes, one to test business logic which I'll refer to as 'class a' (this one works fine regardless) and one to test reading of data from the DeploymentItem file which I'll...

C# using static variable as parameter to DeploymentItem

I want to use a static variable as the parameter to DeploymentItem on an MSTest unit test but it doesn't seem I'm able to do so. There's an XSL file that needs to be copied along with the DLL file when the unit test runs, and I defined the location as private static string _xslPath = Path.Combine("MyProjectDir", "transform.xsl"); How...

C# DeploymentItem fails to copy file for MSTest unit test

I'm having trouble getting an XSL file to be copied to the same directory as the test assembly when I use the DeploymentItem attribute on an MSTest unit test. I followed the chosen answer for this question and the file I need copied has its "Copy to Output Directory" set to "Copy Always". When I check my ProjectDir\bin directory (the T...

Copy all files/subfolders to Testrun Out dir?

I need to copy all files and subfolders from a specified path to my testrun Out folder. I only want this to happen for certain tests (so, no global solution, like the Deployment section in the Testrunconfig file). I have a solution structure like this Solution\ Project\ Project.Test\ Resources\ FolderA\ Fold...

MSTest VS2010 - DeploymentItem copying files to different locations on different machines

I have found that DeploymentItem [TestClass(), DeploymentItem(@"TestData\")] is not copying my test data files to the same location when tests are built and run on different machines. The test data files are copied to the "bin\debug" directory in the test project on my machine, but on my friend's machine they are copied to "TestResul...

DeploymentItem fails copying directories when there are multiple test projects per solution

I have a number of test classes and methods that copy a particular directory like so: [TestClass, DeploymentItem("LanguageData", "LanguageData")] public class OcrTests { [TestMethod] public void Can_Capture_Field() { // some code that expects the LanguageData directory to be in the test results Out directory } ...

Do MSTest deployment items only work when present in the project test settings file?

I can't seem to grasp how MSTest deployment items are supposed to be configured. I have been able to get them working properly by modifying the project's test settings file, but this is less then ideal -- the deployment item configuration is separated from individual tests, and the file paths appear to be stored as absolute paths unless ...