I\'m new to C# 4.0 and WPF and I\'m about to start a new application.
Coming from a C++/MFC world, I\'m interested in testing strategies used with the up to date technol
I care a lot about the view looking right. That means unit testing. For me, the best technique is to ONLY test the view in a single unit test, that means
model + view = result.
The open source verification utility ApprovalTests (www.approvaltests.com or nuget ) will easily test Wpf views.
You can see it in action here: http://www.youtube.com/watch?v=Xc_ty03lZ9U
I'd recommend watching the winforms video 1st though, as it goes into more of the theory of how to test views in general: http://www.youtube.com/watch?v=hKeKBjoSfJ8
The code itself will look like
var model = CreateModel();
var yourWpfView = new YourWpfView(model);
WpfApprovals.Verify(yourWpfView);
and it will take a screenshot and compare it against a golden master.