5

Let Say I have following C# project structure in Visual Studio

  • Spec
    • UserStory1.html
    • UserStory2.html
  • Tests
    • Test1.cs
    • Test2.cs

Now I want to connect my unit tests with Specification written in html in the following way

//http://../path.to.UserStory1.html#or_even_some_anchor
[TestFixture]
public class Test1
{
    [Test]
    public void SomeTest()
    {

    }        
}

That way when I CTRL+Clik on the link in the comment I can jump to the specification and see what should be really tested. Problem is that I don't know how to do a relative path to html file included in the project.

  • How can I do that?
  • If not in standard VS, is there some plugin available that will enable this?
1
  • Did my answer below solve your problem? Commented Jun 19, 2015 at 18:13

1 Answer 1

3

I think that in your case the <see/> documentation tag would make the most sense, but others are available.

This would change your example code to be the following:

/// <summary>
/// This test does something
/// </summary>
/// <see cref="http://../path.to.UserStory1.html#or_even_some_anchor"/>
[TestFixture]
public class Test1
{
    [Test]
    public void SomeTest() { }        
}

I tested with http://www.google.com and it opened it in a new tab within VS. All of this is built into VS without any additional add-ons.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.