Writing unit tests requires that your logic code is separated from your UI code. Using MVVM pattern is a nice solution because it separates the concerns, especially with WPF and Windows RT apps. To go more on that goal, it's just useful to remove the click events.