【问题标题】:ReSharper + NUnit tests show inconclusive when testing inheritanceReSharper + NUnit 测试在测试继承时显示不确定
【发布时间】:2016-02-29 12:25:38
【问题描述】:

使用 Resharper Ultimate 10 和 NUnit 3 尝试编写一些具有基类的单元测试

[TestFixture]
public abstract class BaseTests
{
    protected BaseTests( /*some parameters */)
    {
        // some ctor code
    }

    [SetUp]
    public void Setup()
    {
        // some setup code
    }

    [Test]
    public void Test1()
    {
        // some tests code
    }

    [Test]
    public void Test2()
    {
        // some tests code
    }
}

[TestFixture]
public class TestA : BaseTests
{
    public TestA() : base(/* some parameters */) { }
}

[TestFixture]
public class TestB : BaseTests
{
    public TestB() : base(/* some parameters */) { }
}

我的问题是单元测试运行器(resharper) 显示这些测试inconclusive,尽管在我调试时没有一个测试失败。

想法?

【问题讨论】:

  • 这对你有用吗?从 ReSharper 10.0.2 和 NUnit 3.0.1 开始,我们仍然无法在 VS 2013 或 2015 中运行 inherited 测试。好奇你是否比我运气好!
  • 我确实成功地使用 RS 和 VS15 运行了这些测试

标签: c# visual-studio unit-testing nunit resharper


【解决方案1】:

目前还不支持 Nunit 3 RTM。当前版本的 ReSharper 10.0.1 仅支持 Nunit 3 Beta 5。ReSharper 10.0.2 将提供支持,它将在未来几周内到期。我不知道current EAP 是否添加了 RTM 支持,但可能值得一试。

【讨论】:

    猜你喜欢
    • 2011-04-07
    • 2016-05-06
    • 1970-01-01
    • 2016-10-11
    • 2014-01-03
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多