【问题标题】:Hyperlinks in VS2008 Test Result DetailsVS2008 测试结果详情中的超链接
【发布时间】:2010-12-16 20:15:48
【问题描述】:

如果“测试结果详细信息”(TRD) 中的结果字符串很长,Visual Studio 2008 会崩溃。我通过将结果数据发送到文件中来解决这个问题。但是,有一个问题,因为没有一种简单的方法可以打开此类文件。当然,我可以手动打开文件夹然后打开文件,但效率不高。现在,到问题部分。

  1. 是否有可能在 TRD 的“错误消息”部分中包含指向文件的超链接? (类似于我们已经在堆栈跟踪部分中找到的内容)
  2. 如果没有,是否有任何方法可以将此类功能(轻松打开文件)添加到 TRD?
  3. 如果没有,有没有办法扩展VS的默认报告?

感谢您的帮助。

【问题讨论】:

    标签: c# visual-studio-2008 unit-testing


    【解决方案1】:
        [TestMethod]
        public void MyTest()
        {
            ...
            testContextInstance.AddResultFile(targetFile);
        }
    
        private TestContext testContextInstance;
    
        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }
    

    【讨论】:

    • 它不符合我的要求。据我测试,它只是将给定文件复制到“In”目录。它不显示文件的超链接。
    猜你喜欢
    • 2012-10-25
    • 2016-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-16
    • 1970-01-01
    • 2018-07-17
    相关资源
    最近更新 更多