Dot-Net
從 Windows 命令行執行 MSTests
我有 5 個使用 MSTest 的解決方案,我想在根文件夾中有一個 cmd 文件來執行所有測試
所以我想從命令行呼叫 MsTests 執行器
\Solution1\Tests\Debug\Test.dll ... \Solution5\Tests\Debug\Test.dll有人知道怎麼做嗎?
這在 MSDN 上有詳細說明:如何:使用 MSTest 從命令行執行自動化測試
基本上,你可以這樣做:
MSTest /testcontainer:\Solution1\Tests\Debug\Test.dll
如果使用 .Net Core:
dotnet test ./nameoftest.dll在測試所在的文件夾中。
有關命令行選項,請參閱: https ://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test