Contents tagged with WPF

  • Testing the PropertyChanged event

    Tags: TDD, WPF

    Testing a ViewModel and it's properties may look quite easy at first. But ViewModels are quite treacherous to their nature. There's no guarantee that the value of a property in a unit test is the same … more

  • INotifyPropertyChanged - A remedy for the plague

    Tags: WPF

    I stumble over this nice little extension class the other day while visiting Google.Instead of passing around a hard coded string for NotifyPropertyChanged like this: private string firstName; … more

  • TDD in a WPF world - Testing the ViewModel

    Tags: TDD, WPF

    Here is a sketch of the basic principles I follow to make my ViewModels more testable:

    I follow the following steps when designing the ViewModel above:

    Create a prototype of the … more

  • TDD in a WPF world - The self injecting View

    Tags: TDD, WPF

    Occasionally, the ViewModel needs to communicate with the View. Most of the times, this is done with bindings. For i.e, activating and deactivating a control at a specific time is easily solved with a … more

  • TDD in a WPF world - Disconnecting the MessageBox

    Tags: TDD, WPF

    Starting TDD'ing our new ViewModel designed app, will soon get us cornered. There are a few pitfalls and hairy situations that will arise quite early on. But, they will mainly get there for one … more

  • TDD in a WPF World - Setting the scene

    Tags: TDD, WPF

    Two fundamental nessecities for testing our WPF applications are: Keep the user interface layer (Xaml) thin.  Xaml is a bit trickier and more tedious to test than plain c#. I … more