In this section:

Overview

You can configure dotTEST to associate tests with a broad range of development artifacts, such as requirements, defects, tasks, and feature requests.

To successfully associate unit tests with artifacts, you need to:

  1. Enable the artifact association property.
  2. Specify issue tracking tags and configure their URL associations.
  3. Use the tags in the NUnit.Framework.PropertyAttribute attribute.

Enabling Artifact Associations

Set the report.associations property to true to enable associations with artifacts. This also enables/disables test associations in the HTML report.

report.associations=true

Specifying Issue Tracking Tags

The following tags for artifact types are associated by default when report associations is enabled:

  • pr (defects)
  • fr (enhancements)
  • task
  • asset
  • req (user stories)

You can use the issue.tracking.tags property to define any number of additional tracking tags. Separate tags names with a comma:

issue.tracking.tags=tag1,tag2,tag3

Configuring Issue Tracking Tags and URL Associations

You enable generating a link to the association in the HTML report by configuring the report.assoc.url.tag{n} option:

report.assoc.url.tag1=[URL]

URLs can contain [%ID%] or ${id} variables, which will be replaced by issue identifiers. For example:

report.assoc.url.tag1=http://bugzilla.company.com/show_bug.cgi?id=[%ID%]

Enabling Test Details

You can enable or disable showing test details in the HTML report:

report.contexts_details=[true | false]

The report.contexts_details property must be set to true to enable showing associations.The product’s property file is preconfigured to enable showing test details.

See Report Settings for additional information.

Using NUnit Attributes

Use the NUnit.Framework.PropertyAttribute attribute to associate NUnit tests with artifacts. See the NUnit documentation for additional information about the PropertyAttribute attribute: http://www.nunit.org/index.php?p=property&r=2.6.3.

Place the tag in the NUnit.Framework.PropertyAttribute attribute to associate it with your tests.

[Property("bug", "1234")]
[Test]
public void Test()
{
     ...
}

You can also associate a tag with a class. As a result, it will be associated with all the tests within this class. In the following example, bug 9876 is associated with both tests within the Test class, whereas bug 111 is associated only with the Test2 test:

[Property("bug", "9876")]
public class Tests
{
   [Test]
   public void Test1()
   {
     ...
   }

   [Property("bug", "111")]
   [Test]
   public void Test2()
   {
     ...
   }
}

Multiple Associations

You can associate one tag with more than one artifact.

[Property("bug", "1234, 1199")]
[Test]
public void Test()
{
     ...
}

You can separate the tasks with a comma, a semicolon or a space character. In the example below, the test is associated with all the listed tasks:

[Property("bug", "1234, 1199; 2345 1928")]
[Test]
public void Test()
{
     ...
}



  • No labels