【问题标题】:Is there any way to unit test xamarin.forms app and use the test set for c.i. with app center?有没有办法对 xamarin.forms 应用程序进行单元测试并将测试集用于 c.i.与应用中心?
【发布时间】:2018-09-18 14:52:38
【问题描述】:

我是 xamarin 表单测试和一般单元测试的新手。我为我的 xamarin.forms 应用程序创建了一个单元测试项目,我编写了一些基本的单元测试,我想知道是否可以使用 appcenter 和 continuos 集成来运行这些测试。 我只能在本地的 windows pc 上运行这些测试,但我的 ci 服务器在 Mac 上运行,所以我想知道我可以使用什么方法来对我的应用程序进行单元测试。

【问题讨论】:

    标签: unit-testing xamarin.forms continuous-integration automated-tests visual-studio-app-center


    【解决方案1】:

    要在 AppCenter 中的 Xamarin 构建中运行单元测试,您可以使用构建后脚本。

    您可以找到执行 NUnit 测试的示例 here,有关如何添加构建后脚本的更多详细信息可以找到 here

    【讨论】:

    • 感谢您的提示@G.sharada 我会尝试为我的环境编写特定的脚本并回复您!
    【解决方案2】:

    我们设法通过添加 Bash Shell 脚本并调用 nunit 控制台来运行单元测试

    /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono ../../../../NUnit.Runners.2.6.3/tools/nunit-console.exe 
    
    APPName_Test/bin/Debug/APPName_Test.dll
    

    稍后编辑:来自 vsts 的报告结果

    【讨论】:

    • 我很想知道您是如何处理测试结果的。你给他们发电子邮件了吗?您怎么知道测试是否失败?
    • 我们刚刚在 vsts 管道中使用了“发布 testet 结果”任务,它给出了一个可视化的结果,我还编辑了我的答案来查看
    猜你喜欢
    • 2016-03-11
    • 1970-01-01
    • 2011-03-23
    • 1970-01-01
    • 2012-03-21
    • 2011-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多