【问题标题】:My nunit tests are not being run from Visual Studio 2013 express我的 nunit 测试没有从 Visual Studio 2013 express 运行
【发布时间】:2014-07-14 15:08:36
【问题描述】:

在下面的代码中,在运行程序中没有找到测试,我不知道为什么。请问有人可以解释为什么吗?

[TestFixture]
public class RepositoryTest
{
    [SetUp]
    public void Init()
    {
    }

    [Test]
    public void whenIAskForAllTheLocationsAllTheLocationsAreReturned()
    {
        var repo = new LocationRepository();
        var locations = repo.GetLocationsByName("%");
        Assert.AreEqual(locations.Count(), 8);
        Assert.AreEqual(locations.First().LocationName, "Kipling Road");
    }
}

【问题讨论】:

  • 除了安装 NUnit 的测试适配器,您还可以使用 Resharper,它会自动检测并运行 MSTest 和 NUnit 测试。
  • @Smith.h.Neil:您应该澄清这不是免费组件...

标签: c# nunit


【解决方案1】:

Visual Studio 默认不会运行 nunit 测试,只会运行 MSTest。为了从 Visual Studio 本地运行 nunit 测试,请安装 NUnit Test Adapter。但不确定它是否适用于特快版。

【讨论】:

    猜你喜欢
    • 2016-05-27
    • 2023-03-24
    • 1970-01-01
    • 1970-01-01
    • 2011-07-03
    • 2017-01-16
    • 1970-01-01
    • 2021-11-30
    • 1970-01-01
    相关资源
    最近更新 更多