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

后端 未结 15 1681
失恋的感觉
失恋的感觉 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:54

    As others have answered - put tests in separate projects

    One thing that hasn't been mentioned is the fact that you can't actually run nunit3-console.exe against anything but .dll files.

    If you're planning on running your tests via TeamCity, this will pose a problem.

    Let's say you have a console application project. When you compile, it returns an executable .exe to the bin folder.

    From the nunit3-console.exe you wouldn't be able to run any tests defined in that console application.

    In other words, a console application returns an exe file and a class library returns dll files.

    I just got bit by this today and it sucks :(

提交回复
热议问题