2

当我执行 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将程序集名称作为第一个参数传递给测试运行程序?

4

1 回答 1

4

不应使用/args将测试容器指定给 moles.runner.exe ,即:

/args:/testcontainer:MyAssembly.dll

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

/afs:"/testcontainer:{0}"

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

于 2011-05-04T15:02:06.483 回答