running unit tests in non-unit test project types RRS feed

  • Question

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

    Wednesday, March 7, 2012 3:09 PM


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

    • Marked as answer by PJ7 Thursday, March 8, 2012 4:47 PM
    Wednesday, March 7, 2012 9:22 PM