nunittestadapter - NUnit Testing of Individual Projects

I use NUnit 2.6.4 to test my code, but would like to switch to using something within Visual Studio 2017. I tried NUnitTestAdapter.WithFramework, but realized that clicking "Run All" (Tests) on Test Explorer windows will build my entire solution in an attempt to discover all tests, and not just build the test project I want. When I build only the project I want, Test Explorer will not discover my tests. and seem to imply that building the whole solution triggers the test discovery.

Is there a way to only discover tests of a specific project, like NUnit is able to do?

1 Answer

  1. Brent- Reply


    In Build menu > Configuration Manager, you can select which projects run in a certain configuration when you select Build menu > Build Solution or Test Explorer window > Run All. You can also add configurations in the manager. Thus, you can have "UnitTestsOfAlgorithms" , "UnitTestsOfDataTables" , and "IntegrationTestsOfStateMachine" , "Debug" , and "Release" configurations, all configured to build the parts of the solution about which different sections of your team care.

    This is not an elegant solution for me, but necessary. It seems that you need to build all projects in the current configuration to trigger test discovery.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>