Write Unit tests into an assembly or in a separate assembly?

后端 未结 5 786
轮回少年
轮回少年 2020-12-16 13:08

When writing unit tests, do you place your tests inside the assembly you wish to test or in a separate test assembly? I have written an application with the tests in classes

5条回答
  •  轮回少年
    2020-12-16 13:37

    In a different assembly. Otherwise your assembly will reference the test framework (eg Nunit.Framework.dll) and you'll need to install it on the customer machine,

    Even if what you ship is a library, and you want your customer to see the unit tests as an example or a specificiation on how to use the objects you provide, there is very little advantage in including in the production assembly.

提交回复
热议问题