当前位置: 动力学知识库 > 问答 > 编程问答 >

resharper - Strange constructor behaviour in nunit parameterized tests

问题描述:

I have a nunit 2.5.10 parameterized test:

[TestFixture(parameter1)]

[TestFixture(parameter2)]

public class MyTest : BaseTest

{

var param="";

public MyTest(string arg)

{

param=arg;

}

[Test]

public Test()

{

//... test stuff

}

}

In VS 12 with Resharper 7.0.1 I run only one fixture but! the constructor is called twice - once before test execution (for one parameter) and then after test execution but for another parameter. Why? Only constructor is called twice, test itsself is running as expected - only one time.

网友答案:

it's a known problem, unfortunately, see RSRP-336641 "When calling certain case on Parametrized TestFixture all cases constructors and TestFixtureSetUp are called."

分享给朋友:
您可能感兴趣的文章:
随机阅读: