开发者

Execute TestSetup only some of the time?

Within one fixture is it possible to markup tests in such a way that the test-setup is only called for some tests and not for others?

[Test] public void TestWithoutSetup() { .. }
[Test] public void TestWithSetup() { ..开发者_如何学Go }

What would I need to do make the above work?


There's no attribute to accomplish what you want.

I would suggest refactoring your test cases into two separate classes that inherit base functionality from an abstract test class. Each test class can have its own setup method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜