running unit tests in non-unit test project types

已答覆 running unit tests in non-unit test project types

  • 2012年3月7日 下午 03:09
     
     

    Since VS doesn't allow grouping related files across different projects, sometimes I like to nest unit tests with their related files.

    This isn't possible in all cases, for example a WCF service cannot be a unit test project type. Really I'd rather not have every project be a test project just because it has test information in it anyway.

    Is it possible to hack VS (2010) to run unit tests in non-unit test project types?

所有回覆

  • 2012年3月7日 下午 09:22
    版主
     
     已答覆

    Hey,

    Till VS 2010, only tests that are part of Test project would be listed in Test View. This is a limitation that has been fixed in Vs 2011.

    To answer you question : One work around to get tests from non-test projects listed in VS is discussed here. Note that it is not a Microsoft recommended way. You shall use it at your own discretion.

    On a related note, if you are not aware of it, even in VS 2010, running tests from MSTEST.exe command line works fine for non test type projects too.

    • 已標示為解答 PJ7 2012年3月8日 下午 04:47
    •