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

后端 未结 15 1652
失恋的感觉
失恋的感觉 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 06:10

    Separate project, but in the same solution. (I've worked on products with separate solutions for test and production code - it's horrible. You're always switching between the two.)

    The reasons for separate projects are as stated by others. Note that if you're using data-driven tests, you might end up with quite a significant amount of bloat if you include the tests in the production assembly.

    If you need access to the internal members of the production code, use InternalsVisibleTo.

提交回复
热议问题