NUnit vs Visual Studio 2010's MSTest?

后端 未结 8 542
生来不讨喜
生来不讨喜 2020-12-28 12:32

I realise that there are many older questions addressing the general question of NUnit v MSTest for versions of Visual Studio up to 2008 (such as this one).

M

8条回答
  •  眼角桃花
    2020-12-28 12:48

    MSUnit runs your test cases under conditions that are different from the actual execution environment. Specifically, the deployed files differ from those that are deployed when you run your actual project. Nethertheless, there is the [DeploymentItem]-Attribute to specify which files shall be deployed by MSUnit. So if your application depends on any external files, such as

    • database files
    • database configuration file
    • application configuration file
    • ...

    then MSUnit is not the right choice, because the MSUnit tests never cover what your file system is going to look like in execution environment. The Visual Studio Project File settings for deploying files (Copy always, Content, etc.) are ignored by the MSUnit runner. So those settings cannot be tested.

提交回复
热议问题