开发者

NUnit base class

I am approaching database testing with NUnit. As its time consuming so I don't want to run everytime.

So, I tried creating the base class and every other database testing classes derive from it as I thought if I will decorate the base class wi开发者_运维问答th [Ignore] attribute then rest of the derived classes will get ignored, but thats not happening.

I need to know is there any way to Ignore set of the classes with minimal effort?


If you don't want to split out integration and unit tests into separate projects you can also group tests into categories

[Test, Category("Integration")]

Most test runners allow you to filter which categories to run which would give you finer grained control if you need it (e.g. 'quick', 'slow' and 'reaaallyy slow' categories)


A recommended approach is seperating your unit tests that can run in isolation from your integration tests into different projects, then you can choose which project to execute when you run your tests. This will make it easier to run your faster running tests more often, multiple times daily or even hourly (and hopefully without ever having to worry about such things as configuration), while letting your slower running integration tests run on a different schedule.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜