c#

C# Unit Testing: Incrementally Improve Testability

Consider a seasoned brownfield (legacy or seasoned project; not new development) project with little to no unit tests. How and where do you start unit testing?  Should you stop all forward development and refactor the entire solution at once to be testable?  Probably not. Most brown field projects were not developed with testing in mind …

C# Unit Testing: Incrementally Improve Testability Read More »

Mango Quick Tips: Background Agents Debugging

Weird Error In attempting to add and test background agents for one of my applications I came across the following error: BNS Error: The action’s start time has passed when trying to create/update the request The error raised immediately after calling the ScheduledActionService.LaunchForTest method while debugging.  I’m not sure what that means but the error …

Mango Quick Tips: Background Agents Debugging Read More »

Quick tip: Twitter OAuth Authority (Nodo vs Mango)

I resolved a small bug in my Twitter OAuth code today that others might find useful.  The bug was found on a phone with Nodo but didn’t exist on Mango phones.  I’ve been using the Mango beta tools for a while now and haven’t really had any problems going back and forth between OS versions …

Quick tip: Twitter OAuth Authority (Nodo vs Mango) Read More »

WP7 – Sharing data between pages with MVVM

Since the start of my WP7 app, I have leveraged IOC (specifically Ninject) to fill dependencies on my ViewModels following the MVVM Light samples.  To briefly summarize, I have an app level resource called Locator which provides properties for each of my ViewModels.  These properties get the instance from the IOC container.  Locator:     public …

WP7 – Sharing data between pages with MVVM Read More »

WP7 – Tombstoning simplified, less duplication

James Ashley posted a great tip on simplifying tombstoning by abstracting IsolatedStorageSettings.ApplicationSettings and PhoneApplicationService.Current.State to a common interface IDataStorage.  This makes storing either temporary state data or more permanent settings data much easier with less code. This was a very good post but the duplication on the two IDataStorage implementations made me cringe a little.  …

WP7 – Tombstoning simplified, less duplication Read More »

Unit Testing the Setting of MediaElementState in Silverlight

I recently had the need to change the state of a MediaElement to coincide with other page functionality.  You can easily change the state of a MediaElement from the code-behind but you can’t unit test this.  At first I thought, it would be easy to just bind the CurrentState property to a ViewModel property but …

Unit Testing the Setting of MediaElementState in Silverlight Read More »