none
running unit tests in non-unit test project types

    Domanda

  • 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?

    mercoledì 7 marzo 2012 15:09

Risposte

  • 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.

    • Contrassegnato come risposta PJ7 giovedì 8 marzo 2012 16:47
    mercoledì 7 marzo 2012 21:22
    Moderatore