.net – NUnit的组合类别?
发布时间:2020-12-14 00:52:34 所属栏目:百科 来源:网络整理
导读:在我的NUnit testfixtrues中,我有一些东西 [Test,Category("catA")]public void test1{ //}[Test,Category("catB")]public void test2{ //}[Test,Category("catA")][Test,Category("catB")]public void test3{ //} 现在在NUnit gui我想要能够选择catA和catB
在我的NUnit testfixtrues中,我有一些东西
[Test,Category("catA")] public void test1 { // } [Test,Category("catB")] public void test2 { // } [Test,Category("catA")] [Test,Category("catB")] public void test3 { // } 现在在NUnit gui我想要能够选择catA和catB,并运行catA和catB存在的测试。目前不是这样,NUnit将运行所有3个测试。 有没有办法将此行为更改为AND条件而不是OR? 我目前正在运行v2.5.0.9122。 提前致谢。
否。没有办法只运行属于两个或更多个特定类别的测试。说实话,几年前我们第一次把这个功能,我从来没有想过。我们尽量保持简单。
顺便说一下,您不需要在test3方法上指定[Test]两次。 [Test] [Category("catA")] [Category("catB")] public void test3 { // } 不是它有所作为。这只是一种风格偏好。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |