开发者

adding a link to a file in the message of a failed MSTest unit test

I have some MSTest unit tests where, when the test fails, I display a path to a file with more information about the failure. I show the full file path, starting with "C:\", but Visual Studio doesn't dis开发者_运维百科play that as a clickable link. It seems possible for that to be a clickable link, because right below the failure message when I view the test results in Visual Studio, there's an "Error Stack Trace" section with clickable links to the lines in the code where failures occurred. I tried making my test's failure message include <a href='c:\my_file.txt'>c:\my_file.txt</a> but that doesn't work--the source shows. When I look at the .trx file that gets created when I do a test run, the contents of TestRun > Results > UnitTestResult > Output > Message includes &lt;a href='c:\my_file.txt'&gt;c:\my_file.txt&lt;/a&gt;. Is there any kind of markup that Visual Studio understands for the contents of the Message node in a .trx file such that I could make a clickable link appear in the Visual Studio test results?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜