What options are available to run unit tests with MonoTouch ? That was one of the first question I asked myself when I started working on MonoTouch (xTouch at the time). In my limitless dreams I imagined people using one (or both) of two strategies.
1) Run your unit tests on your main, development, computer.
- Easy (use the tools you know) and fast (many cores/Ghz are available);
- If you share code (with other .NET desktop, web, [Silver|Moon]light, Mono for Android… applications) then sharing tests is the next logical step.
2) Run your unit tests on your devices (and simulator), because:
- some API are only present in iOS (and at some point mocking is not option anymore);
- MonoTouch has some limitations (e.g. no code generation) and missing API (e.g. reflection.emit) that you want your code tested against;
Since I knew option #1 would always be available I starting looking for a iOS unit test runner. Surprisingly I did not find anything – even after asking on stackoverflow (and yes the number of votes I got surprised me too).
So the hacker in me started forking. First NUnitLite for the unit test framework, next Miguel’s MonoTouch.Dialog for UI and finally a (very small) bit of my own logic to glue them together: Touch.Unit was born.
It’s plain KISS and I don’t plan a lot of extra features (just fork it
but it allows developers to easily create “test runner applications” and have them executed (and debugged) on the iOS simulator and devices – and that’s makes me happy and you’re welcome to join me in my happiness.
Awesome, like freaking Christmas. Was hoping you’d start an open source project like this when I saw the SO question. I probably won’t be able to sleep tonight!
Thank you for this. Do you have any plans to port it to Mono for Android?
No immediate plan for Android – but if I ever need it then I’ll look around first and code/fork second
Pingback: Linker vs Backing Fields | surprisingly unimpressed
You should probably make that the accepted answer on SO
Nice work
Pingback: Andr.Unit joins the family | surprisingly unimpressed
This is an excellent summary, thanks for taking the time.
Pingback: Linker vs Linked Away exceptions | surprisingly unimpressed
Pingback: Andr.Unit features parity | surprisingly unimpressed
Pingback: Touch.Unit getting closer to you | surprisingly unimpressed
Pingback: Touch.Unit Automation Revisited | take a bit, get a byte
Pingback: It's the Tests » Blog Archive » NUnitLite 0.7 Release
Pingback: Touch.Unit vs NUnitLite 0.7 | take a bit, get a byte
Pingback: Graphics vs Resolution Independance | take a bit, get a byte
Pingback: Mono for Android–Beyond getting started | roundcrisis.Find<Solution>()