donderdag 18 juni 2009

How to: Configure Test Deployment

How to: Configure Test Deployment: "To deploy items for a single test using the DeploymentItem attribute
Open the source-code file that contains a unit test. For more information, see How to: Author a Unit Test.
Under the TestMethod attribute, add a DeploymentItem attribute.
For the parameter of the DeploymentItem attribute, specify the folder or file that you want to deploy for this test. You can use either an absolute path or a relative path. Relative paths are relative to the RelativePathRoot setting found in the .testrunconfig file.
Example in C#:
[TestMethod]
[DeploymentItem('MyTestProject\\testdatasource.mdb')]
public void TestMethod1()
{
// TODO: Add test logic here
}"

Geen opmerkingen: