On Xamarin, Unit Testing and Madness

This is part grouse, part warning so hopefully someone else is saved from falling into this trap.

So I’ll just get this off my chest right now. I don’t much care for Xamarin. Sure, it’s better than the version of MonoDevelop that Unity developers have been saddled with until the very recent release of Unity 4.3 (and I admit I’ve spent no time getting friendly with Unity’s updated version of MD), but to anyone used to Eclipse, Intelli-J or most any other IDE, it’s really a pretty poor candidate for serious developers IMO. It’s buggy, feature-poor, the tools are clunky and implementation is irregular. To be fair, as a Unity dev I’m not really using it for its intended function, i.e., building C#-based iOS and Android apps. So maybe I’m not their target audience.

But even with that as an introduction, my recent hair-pulling with Xamarin and unit testing took me by surprise. When developing Strange, I work almost exclusively in an NUnit testing environment. That means I’m not running an application per se, I’m just writing unit tests, watching them fail, then writing code to make them stop failing. And you receive the results in the form of a tested Inversion-of-Control framework.

Almost from the beginning, I’ve needed Console output to assist in that TDD approach. And I’ve not had it. I’ve scoured the documentation and the help boards but couldn’t figure out why it wouldn’t work for me. I found threads and docs and more docs but none of them adequately explained why a simple Console.WriteLine() never showed results in the Application Output pad. Two days ago, I posted my own thread on the Xamarin boards (yes, I should have done this sooner) and now finally, after struggling for over a month, I have an answer. Get this:

  1. If you’re unit testing, the Console output doesn’t go to Application Output, it gets redirected to Test Results.
  2. But you STILL won’t see that output unless you toggle both the ‘Output’ button and the toggle for Failed/Successful/Inconclusive Tests, as appropriate (oh, and they’re not on by default).
  3. This is documented…where? (I’ve just received a semi-official response and the answer is…nowhere)

Now I’m not arguing with the utility of being able to sift your test output. Sure, I’ll probably want to see output from my Failed Tests more often, and in those cases it’ll be nice to hide the Successful Test output. But does this really need to be in a special window? Should this be documented? Might Xamarin have contextual help or even a wiki?

Maybe I’m an idiot. It’s possible. We all do stupid stuff from time-to-time. But I feel roundly burned by an incredibly squirrelly implementation and inadequate documentation. And the bottom line is this: as things stand I will jump ship the moment someone offers me a more credible solution. And that doesn’t speak well for any product.


2 thoughts on “On Xamarin, Unit Testing and Madness

  1. Good findings! It’s amazing how this is even a struggle with so many IDE options out there. MD is a nightmare. I’ve officially switched back to my ever-trustworthy friend VIM. And have found a few compilers for NUnit, Unity, etc. 🙂 Cheers~

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s