Today I presented the topic of unit testing (surprise, surprise) and Test Driven Development for windows pone applications.
I’d like to thank those who managed to arrive to the meeting despite the weather – it was a pleasure.
My talk was at the second part of the meeting – right after Eyal who showed how to use SignalR with windows phone and had a cool demo in which he controlled a game remotely using his phone (asteroids).
The code for my session is already on GitHub and here are the slides to go with it:
I’ve enjoyed preparing for this talk and I hope I’ll make the time in the future to continue working on the library I’ve created for this session.
But until then:
Happy coding…
Reflection.Emit is supported in Windows Phone, from v7.1/5 (Mango) onwards.
E.g http://msdn.microsoft.com/en-us/library/csx7wsz2(v=vs.95).aspx
This is contrary to what I found on the internet…
When I couldn't find a mocking framework for testing my WinPhone application I found several posts that explain that it was due to the fact that you cannot emit code in WinRT/WinPhone (http://stackoverflow.com/a/12119025/11361).
I should probably change the slide with more accurate reason.
What I know for sure is that currently there are no mocking frameworks for Windows Phone applications.
The SO question is specifically relating to WinRT. Windows Phone is a hybrid of Silverlight on top of WinRT and so lots of the Silverlight supporting mocking frameworks will work with Windows Phone 8. I'm using MOQ in a WP8 project at this moment.
There's an example of how to do this at http://wp.qmatteoq.com/unit-testing-in-windows-phone-8-asynchronous-operations-and-mocking/
That's good to know. I wonder why no “official” NuGet package exist for any of the Mocking Frameworks.
I guess I need to revise that slide – thank you for (very) useful piece of information.