views:

192

answers:

2

Hi all,

How would you suggest I write a unit test to check that a UI object is bound to a particular named property in my ViewModel?

Thanks, Mark

+1  A: 

You can just write your unit test against your View Model. Since the View Model has no knowledge of the View, you are free to swap out the View for something else - such as your unit tests.

Andy
A: 

I haven't found a way to get the existing Bindings for a UI object so I'm not sure that you could make that check. Andy's advice to write your tests against the ViewModel seems like the way to go.

James Cadd