Visual Studio中注释中带有http相对链接的c#.cs文件
假设我在VisualStudio中有以下C#项目结构Visual Studio中注释中带有http相对链接的c#.cs文件,c#,visual-studio,unit-testing,comments,C#,Visual Studio,Unit Testing,Comments,假设我在VisualStudio中有以下C#项目结构 规格 UserStory1.html UserStory2.html 测验 Test1.cs Test2.cs 现在我想用以下方式将我的单元测试与用html编写的规范连接起来 //http://../path.to.UserStory1.html#or_even_some_anchor [TestFixture] public class Test1 { [Test] public void SomeTest()
- 规格
- UserStory1.html
- UserStory2.html
- 测验
- Test1.cs
- Test2.cs
//http://../path.to.UserStory1.html#or_even_some_anchor
[TestFixture]
public class Test1
{
[Test]
public void SomeTest()
{
}
}
这样,当我在注释中的链接上按住CTRL+Clik键时,我就可以跳转到规范,看看应该真正测试什么。
问题是,我不知道如何创建项目中包含的html文件的相对路径
- 我该怎么做
- 如果不是在标准VS中,是否有一些插件可以启用此功能
- 我认为在您的情况下,文档标签最有意义,但是
这会将示例代码更改为以下代码:
/// <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() { }
}
//
///这个测试有点作用
///
///
[测试夹具]
公共类Test1
{
[测试]
public void SomeTest(){}
}
我用进行了测试,它在VS中的一个新选项卡中打开了它。所有这些都内置在VS中,没有任何附加组件。我下面的答案解决了您的问题吗?