如何在Mac上运行Mstests?

时间:2011-09-02 20:53:40

标签: macos visual-studio-2010 mono automated-tests

我需要编写一些mstests并在Mac上运行这些测试。正在测试的源代码的二进制文件已在Mac上启动并运行。

要运行Visual Studio编写的测试自动化,我是否遵循相同的流程?关于如何开始运行这些测试用例的任何指示在Mac上使用Mono

4 个答案:

答案 0 :(得分:1)

我知道这个问题已经过时但我在搜索在Mac上运行MSTest的解决方案时遇到过这个问题。我将调查以上内容,但也值得注意的是VS 4 Mac上的MSTest支持迫在眉睫:

  

Visual Studio for Mac中的MSTest支持将在15.5发布周期中提供,即VSfM 7.3,计划在几周内打入Alpha通道。   (2017年9月20日)

See this github issue

但是 - 如果你不能等待 - 你可以使用dotnet cli命令:

  

dotnet test CreditCardValidator.iOS.MSTestAppium / CreditCardValidator.iOS.MSTestAppium.csproj

     

构建已开始,请稍候......构建完成。

     

试运行   /Users/owenniblock/test-apps/CCExampleAppium/CreditCardValidator.iOS.MSTestAppium/bin/Debug/netcoreapp2.0/CreditCardValidator.iOS.MSTestAppium.dll(.NETCoreApp,Version=v2.0)Microsoft(R)测试执行命令行工具版本

     

15.3.0-preview-20170628-02版权所有(c)Microsoft Corporation。保留所有权利。

     

开始测试执行,请稍候......失败

     

CreditCardValidator.iOS.MSTestAppium.Tests.IntentionalFailure错误   消息:Assert.IsTrue失败。堆栈跟踪:at   CreditCardValidator.iOS.MSTestAppium.Tests.IntentionalFailure()in   /Users/owenniblock/test-apps/CCExampleAppium/CreditCardValidator.iOS.MSTestAppium/Tests.cs:line   21

     

总测试:3。通过:2。失败:1。跳过:0。测试运行失败。

     

测试执行时间:1.0736秒

答案 1 :(得分:0)

我宁愿尝试将它们转换为NUnit,它在单声道上工作正常。也许你可以试试this

答案 2 :(得分:0)

现在看来这是可能的,但你必须自己构建可执行文件(此时):
https://github.com/Microsoft/testfx
https://github.com/Microsoft/testfx-docs/blob/master/docs/contribute.md#building-with-visual-studiovs

您应该遵循"使用Visual Studio构建"说明,使用VS for Mac或Xamarin Studio。

更新:我自己尝试使用VS for Mac v.7.1.3并且没有成功。从理论上讲,这是可能的,但是......你可以在GitHub上看到它,所以你应该能够在那里提交一个问题,如果没有合适的问题。

答案 3 :(得分:0)

同样,在尝试在项目上实施MSTest时遇到了这个问题,我可以确认VS 4 Mac v8.8支持MSTest并且运行良好。