Welcome to Habanero Land!   Register  |  Login
You are here:   Blogs
  So, why do you need to register to download Habanero and access the additional materials? 
The success of any open source project is based on the community built around it. So go ahead, register / login and get involved!
Dec
16
Thu
Posted By Andrew on Thursday, December 16, 2010
72 Views


This is the second blog in a series of blogs I have put together whilst trying to find a solution for unit testing WPF Bindings.

It’s time for a second attempt at testing the bindings on a WPF window. I don’t think my first attempt was a complete failure but, I am sure there must be a better way to solve this problem. Back to the internet to see what else is out there.

After some digging around, I found a little utility application, called “BindingFinder”, written by Rob Reylea. The source code is can be downloaded from his blog (http://blogs.windowsclient.net/rob_relyea/ ). At first glance it looks like the code opens a Xaml file and scans the contents for bindings. What I like about this is the fact that you won’t have to create a window and open it to get the bindings. I am not mad about opening windows during a unit test as it introduces a number of other problems to consider:

  • How to handle threading differences between the unit test runner and the WPF application
  • How to run the tests in a continuous integration environment

The original snippet of code on Rob’s blog that got me interested has turned into something bigger and more complicated in the “BindingFinder” utility. After having a play around with the code, I have decided that although this was a promising lead it would probably require a fair amount of effort to get what I wanted out of the code and would also introduce dependencies on file paths etc. I think I am going to leave this code for the time being and see what else is out there.

Categories

 Top Viewed
 Habanero Cloud
 Archive
 

This website is best viewed in Internet Explorer 7 & 8; Firefox 3.6.11; Opera 10.63; & Safari 4.