Friday, August 2, 2013

Unit test text editor integration


Writing unit tests should be easy and fun.
What bugs me about writing tests in Xamarin Studio is that testing requires a context switch.

I write my test and then I need to compile the test project and trying to search the test in the unit test pad (which doesn't support search - but that's another story :)). 

This disturbs my workflow.

What I really want is to be able to just run the test I'm working on. I don't need to run the full suite (that's what continuos integration is for) - just the current test. 

I've been working on the solution: Unit test text editor integration. 

This feature is not finished but it's already in the public repositories and I think Xamarin Studio 4.2 will contain it. It's a bit hidden in the options - but once it's activated it makes life much easier: 

 

 After it's active a new margin appears in the text editor: 


This margin parses the current file and marks all unit tests. 
Clicking on one of these icons let the user choose to Run or Debug the tests. No write->build->search test in pad->run test->change test->repeat cycle anymore - just write->run test->repeat. This feature has made my life much more easier. See it in action:  Demo video