【问题标题】:Usage of moles.runner.exe with MSTest.exe as the test runner使用 moles.runner.exe 和 MSTest.exe 作为测试运行程序
【发布时间】:2011-05-04 14:48:01
【问题描述】:

当我执行 moles.runner.exe,提供 MSTest.exe 作为运行程序时,我看到了一个错误。

这里是命令行:

moles.runner.exe MyAssembly.dll /r:MSTest.exe /args:/resultsfile:output.trx /args:/testcontainer:MyAssembly.dll

这是输出:

Microsoft Moles Runner v0.94.51023.0 -- http://research.microsoft.com/moles -- .NET v4.0.30319
Copyright (c) Microsoft Corporation 2007-2010. All rights reserved.

instrumenting...started
Microsoft (R) Test Execution Command Line Tool Version 9.0.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.

Invalid switch "MyAssembly.dll"
For switch syntax, type "MSTest /help"

当我使用 /d(诊断模式)执行 moles.runner.exe 时,它​​会显示:

r>MSTest.exe MyAssembly.dll /resultsfile:output.trx /testcontainer:MyAssembly.dll

如何将 moles.runner.exe 定向到将程序集名称作为第一个参数传递给测试运行程序?

【问题讨论】:

    标签: mstest moles


    【解决方案1】:

    测试容器不应该/args指定为moles.runner.exe,即:

    /args:/testcontainer:MyAssembly.dll
    

    应该使用 /afs (RunnerAssemblyFormatString) 指定,如下所示:

    /afs:"/testcontainer:{0}"
    

    这将指示 moles.runner.exe 在 MSTest.exe 所需的 /testcontainer 参数中输出测试程序集。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      • 2010-12-06
      • 2014-05-29
      • 1970-01-01
      • 1970-01-01
      • 2011-05-31
      • 2012-11-17
      相关资源
      最近更新 更多