Wednesday, February 28, 2007
This is an addition to my article on how to deploy resources used within unit tests.

A Visual Studio 2005 Team System solution containing at least one unit test project, also includes a configuration file, which is used to setup your test runs ("localtestrun.testrunconfig" in the example below). Its deployment section may be used to specify which files or directories should be deployed for the run.

Wednesday, February 28, 2007 8:49:19 AM (GMT Standard Time, UTC+00:00)
 Thursday, January 25, 2007
Running Visual Studio unit tests with a bunch of different files to be deployed is quite inconvenient. See what Sergey found out on that issue here.

Suppose you have several tests all using x different files, which are to be deployed separately. So currently there seemed no other way than adding x different deployment attribute values on each test:

[TestMethod]

[DeploymentItem("testfile_1.txt")]

[DeploymentItem("testfile_2.txt")]

   ...

[DeploymentItem("testfile_x.txt")]

public void MethodXzyTest()

{

}

A convenient solution is to move those files into a separate folder (here "TestData") within the Visual Studio solution. Now only this folder needs to be specified as deploymentitem:

[TestMethod]

[DeploymentItem("TestData\\")]

public void MethodXzyTest()

{

}

However, what still seems to be missing is a way to declare deployment items at some central place within the test class.

Thursday, January 25, 2007 5:14:33 PM (GMT Standard Time, UTC+00:00)
Latest Postings
Tags
History
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
License
Except where otherwise noted, content on this site is licensed under Creative Commons Attribution 3.0 Unported License:
Creative Commons Attribution 3.0 Unported License