Integration Testing best practices

后端 未结 5 413
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 03:42

Our team has hundreds of integration tests that hit a database and verify results. I\'ve got two base classes for all the integration tests, one for retrieve-only tests and

5条回答
  •  猫巷女王i
    2020-12-24 04:27

    in NUnit you can decorate your test classes (or methods) with an attribute eg:

    [Category("Integration")]
    public class SomeTestFixture{
        ...
    }
    [Category("Unit")]
    public class SomeOtherTestFixture{
        ...
    }
    

    You can then stipulate in the build process on the server that all categories get run and just require that your developers run a subset of the available test categories. What categories they are required to run would depend on things you will understand better than I will. But the gist is that they are able to test at the unit level and the server handles the integration tests.

提交回复
热议问题