I\'ve been pushing my Google Fu to the limits trying to find the most recommended / stable setup for doing TDD + CI for Windows Phone applications. Can anyone who has successful
I think a matter of this has to due with how you write your tests.
The other tool you will want is MVVMLight. This will allow you to use EventTrigger and ICommand instead of events, since testing the events is significantly more work and can't be bound through the DataContext.
As far as how I designed my application:
The ViewModel can take in any number of dependencies, which get resolved using MicroIoC.
The actual code behind of the XAML resolved the ViewModel and sets it to the data context. This is unfortunate because that means you can't set the DataContext in XAML, but was a trade off I was willing to accept for dependency injection, like this:
public partial class SignUpPage
{
public SignUpPage()
{
InitializeComponent();
DataContext = IoC.Resolve();
}
}
Fortunately, that's the only C# code that actually appears in my XAML code behind. From there, it's fairly regular MVVM with using binding and the DataContext.
Now you can test your ViewModel, inject the required dependencies (or fake them out) and it'll run fine without being in the emulator, so long as you don't try to use something WP7 specific.