Usage of moles.runner.exe with MSTest.exe as the test runner
When I execute moles.runner.exe, providing MSTest.exe as the runner, I'm seeing an error.
Here is the command line:
moles.runner.exe MyAssembly.dll /r:MSTest.exe /args:/resultsfile:output.trx /args:/testcontainer:MyAssembly.dll
Here is the output:
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"
When I execute moles.runner.exe with /d (Diagnostic mode), it shows this:
r>MSTest.exe MyAss开发者_运维问答embly.dll /resultsfile:output.trx /testcontainer:MyAssembly.dll
How can moles.runner.exe be directed to not pass the assembly name as the first argument to the test runner?
The test container should not be specified to moles.runner.exe with /args, i.e.:
/args:/testcontainer:MyAssembly.dll
Instead, it should be specified with /afs (RunnerAssemblyFormatString) as follows:
/afs:"/testcontainer:{0}"
That will instruct moles.runner.exe to output the test assembly within the MSTest.exe-required /testcontainer argument.
精彩评论