2

MSTest.exe をランナーとして提供して、moles.runner.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 に答える