2017-10-19 141 views
0

按照SpecFlow網站,我可以生成通過執行以下語句的TestResult:生成的TestResult與NUnit控制檯失敗

nunit3-console.exe --labels=All --out=TestResult.txt "--result=TestResult.xml;format=nunit2" bin\Debug\BookShop.AcceptanceTests.dll 

我已經適應了這個聲明如下:

nunit3-console.exe --labels=All --out=C:\temp\TestResult.txt "--result=C:\temp\TestResult.xml;format=nunit2" C:\Projects\DataService.IntegrationTests\bin\Debug\DataService.IntegrationTests.dll 

不幸的是,我得到以下錯誤:

錯誤,故障和警告

1)無效:C:\ Projects \ DataService.IntegrationTests \ bin \ Debug \ DataService.IntegrationTests.dll 在'C:\ Projects \ DataService.IntegrationTests \ bin \ Debug.DataService.IntegrationTests.dll中找不到合適的測試」。 組件中不包含任何測試或未找到正確的測試驅動程序。

.feature文件在本次大會提供...

可以在這裏是什麼問題?

我的一個假設是,我們正在使用Specflow.MsTest ...
有沒有辦法通過使用MsTest生成TestResult.xml

在此先感謝

+0

你有什麼在你的app.config配置爲您的unitTestProvider? –

+0

我配置了MSTest – xeraphim

+0

好的,但是爲什麼您通過NUnit執行測試?您必須爲MsTest使用vstest.console.exe。 –

回答

1

NUnit3-console只能運行NUnit測試。 (從技術上講,它可以運行任何測試,但是它可以運行相同的測試。)

如果要創建NUnit輸出,請同時使用NUnit框架和NUnit控制檯運行器。 MsTest不會執行NUnit輸出。

0

在app.condig我沒有任何unitTestProvider

<specFlow> 
    <stepAssemblies> 
     <stepAssembly assembly="otherProject" /> 
    </stepAssemblies> 
    <runtime detectAmbiguousMatches="true" stopAtFirstError="false" missingOrPendingStepsOutcome="Inconclusive" /> 
    <trace traceSuccessfulSteps="true" traceTimings="false" minTracedDuration="0:0:0.1" /> 
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --> 
    </specFlow>