通过ReSharper运行的NUnit .NET Core [英] NUnit .NET Core running through ReSharper

查看:166
本文介绍了通过ReSharper运行的NUnit .NET Core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过ReSharper在Visual Studio 2017中为.NET Core 2.0项目运行NUnit测试。我已经将测试.proj程序集设置为控制台应用程序和类库。因此,它似乎不是输出类型。该解决方案不会发现任何单元测试,只会运行0个测试而不会显示任何结果。

I am trying to run NUnit tests for a .NET Core 2.0 project in Visual Studio 2017 through ReSharper. I've had the test .proj assembly set both as console application and class library. So it doesn't seem to be the output type. The solution does not discover any unit test and just displays no results with 0 tests run.

这是我用于测试项目的.csproj文件:

Here is my .csproj file for the tests project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <AssemblyName>eCorp.WebStore.OrderService.Tests</AssemblyName>
    <RootNamespace>eCorp.WebStore.OrderService.Tests</RootNamespace>
    <ApplicationIcon />
    <OutputType>Exe</OutputType>
    <StartupObject />
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
    <PackageReference Include="NUnit" Version="3.9.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\Core\OrderService.Domain\OrderService.Domain.csproj" />
    <ProjectReference Include="..\..\Core\OrderService.Infrastructure\OrderService.Infrastructure.csproj" />
  </ItemGroup>

</Project>

我已经发现:
在.NET Core中运行NUnit测试

I found this already: Run NUnit tests in .NET Core

提供的解决方案似乎都不适合我。

None of the provided solutions seem to work for me.

推荐答案

我通过安装以下NuGet软件包来解决

I solved by installing the following NuGet packages


  • NUnit

  • NUnit3TestAdapter

  • Microsoft.NET.Test.Sdk

这篇关于通过ReSharper运行的NUnit .NET Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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