在Resharper“单元测试会话”窗口中控制NUnit输出

时间:2017-08-14 19:25:02

标签: c# unit-testing nunit resharper

我正在尝试改进一些单元测试,并且我注意到NUnit的输出表现不合需要;我想知道我是否有能力控制它。

考虑以下OneTimeSetUp

Imports NUnit.Framework

Public Class SimpleInconclusive
    <OneTimeSetUp>
    Public Sub OneTimeSetUp()
         Assert.Inconclusive("Why do I print twice?")
    End Sub
End Class

如果我在任何测试夹具中继承此类,则输出的行为不符合要求。

考虑这个简单的样本

[TestFixture]
class Class1 : SimpleInconclusive
{
    [Test]
    public void MySimpleTest()
    {
        // no-op
    }
}

The fixture output displays the inconclusive report for each test, rather than once for the whole fixture.

The test output does not display in the output window.

相当令人沮丧,因为这会使窗口混乱,意味着提供易于操作的消息。

我可以直观地理解这一点,输出窗口只显示突出显示的测试/灯具的输出,而不是多次重复同一消息的聚合消息吗?

0 个答案:

没有答案