在linux平台上对.NET核心进行单元测试 [英] Unit testing for .NET core in linux platform
问题描述
大家好,
我有一个.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
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屋!