Do you put unit tests in same project or another project?

后端 未结 15 1682
失恋的感觉
失恋的感觉 2020-12-02 05:23

Do you put unit tests in the same project for convenience or do you put them in a separate assembly?

If you put them in a separate assembly like we do, we end up wit

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 05:53

    I fluctuate between same project and different projects.

    If you're releasing a library releasing the test code with the production code is a problem, otherwise I find it usually isn't (although there's a strong psychological barrier before you try).

    When putting tests in the same project I find it easier to switch between tests and the code they test, and easier to refactor/move them around.

提交回复
热议问题