VS 2010 and MBUnit, how to run only one test

I have Gallio / MbUnit installed and I use VS 2010 RC, and I want to be able to run one unit test or only all unit tests inside TestFixture, and not all tests in the whole project every time I debug it. How do you do this in VS 2010?

+4
source share
4 answers

I have not seen this before, but VS 2010 has a test list editor that allows me to add a specific test to the list and run it from there to run only one test. I know that TD.Net probably has a right-click / launch test method for the test method, but I did not want to buy it and install another tool.

+2
source

Install testdriven.net, there is a free personal version

http://www.testdriven.net/

+5
source
  • As Simon said, TD.Net works well.
  • If you are working with VS2010 Premium or Ultimate, you can also use the built-in test run feature of VS2010. It should also find and run your MbUnit tests (if the Gallio add-in was installed)
  • You can also run your tests using Resharper 5 , but it seems that the latest beta version of Resharper 5 broke the Gallio test driver, however, it should be fixed soon.

In addition to ID2 VS2010, you can also run your tests using Echo (a powerful console application located in the bin folder in the Gallio installation directory), Icarus (Winform with a good user interface, in the same place) or from PowerShell (using Run-Gallio snap ). You can also call a test leader from one of the many Gallio extensions for MSBuild, NAnt, TeamCity, etc.

+3
source

Another alternative, as we do this, is to select the specification inside the visual studio, press F5 and execute the specification using the Rake task.

Example:

class DiffuserObserverSpecification : AutoMockSpecification<DiffuserObserver, IDiffuserObserver> class When_diffuser_observer_is_created : DiffuserObserverSpecification class When_diffuser_observer_has_injected_diffuser_change : DiffuserObserverSpecification 

So, to fulfill the expectations of the behavior of all DiffuserObserverSpecification, we select DiffuserObserverSpecification and press F5.

And to perform only the behavior for the When_diffuser_observer_is_created parameter, select it and press F5.

After a month, you will forget what the debugger looks like.

+1
source

Source: https://habr.com/ru/post/1301139/


All Articles