在linux平台上对.NET核心进行单元测试 [英] Unit testing for .NET core in linux platform

查看:106
本文介绍了在linux平台上对.NET核心进行单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个.net核心应用程序,它使用MS测试工具进行单元测试,并在Windows中使用命令'dotnet test'正常工作,并显示失败和传递的结果。但现在我被困在linux平台上了。我怎样才能在linux平台上做同样的事情。是否为linux平台发布它解决了我的问题?



提前谢谢



我尝试了什么:



< runtimeidentifiers> win10-x64; .csproj中的ubuntu.16.04-x64

解决方案

我建​​议切换到xunit进行.NET Core单元测试。



您可以直接从 JetBrains跨平台.NET IDE运行xunit测试骑手 [ ^ ]。或者,您可以使用以下命令从命令行运行xunit测试:

 


dotnet xunit



请参阅: xUnit.net入门(.NET Core / ASP.NET核心)> xUnit.net [ ^ ]


Hi all,
I have a .net core application that use MS test tools for unit testing and works fine in windows using the commands 'dotnet test' and displays the failed and passed results. But now I am stuck up for linux platform. How can I do the same in linux platform.Whether publishing it for linux platform solve my problem?

Thanks in advance

What I have tried:

<runtimeidentifiers>win10-x64;ubuntu.16.04-x64 in .csproj

解决方案

I'd recommend switching over to xunit for your .NET Core unit tests.

You can run xunit tests directly from JetBrains cross-platform .NET IDE "Rider"[^]. Alternatively, you can run xunit tests from the command line using the following command:


dotnet xunit


See: Getting started with xUnit.net (.NET Core / ASP.NET Core) > xUnit.net[^]


这篇关于在linux平台上对.NET核心进行单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆