Note that there are some explanatory texts on larger screens.

plurals
  1. POIn MVVM with WPF how do I unit test the link between the ViewModel and the View
    primarykey
    data
    text
    <p>In MVVM it is normal to connect View to the ViewModel with data binding.</p> <p>Therefore if the name of a properties changes on one of the Model objects that is databound to there is no compiler error.</p> <p>When the compiler will not stop a bug, the next thing I think of is “UnitTest”, However </p> <blockquote> <p>How do you unit test this without spending forever writing a GUI test?</p> </blockquote> <p>Is there a system that will check that all the properties that are bound to is valid, (without having to run the UI) that I can call in a unit test?</p> <p><strong>I am looking for something that will take the view, and then loop over all WPF controls, for each WPF control it will look at all the binding and check if they are valid.</strong> </p> <hr> <p>By the way there have been a few good questions about how to make OnPropertyChanged safe, and/or how to test it (But done of these get down to the level of a WPF view.)</p> <ul> <li><a href="https://stackoverflow.com/questions/1329138/how-to-make-databinding-type-safe-and-support-refactoring/1329275">How to make Databinding type safe and support refactoring</a> </li> <li><a href="https://stackoverflow.com/questions/527602/automatically-inotifypropertychanged/527840#527840">Automatically INotifyPropertyChanged</a></li> <li><a href="https://stackoverflow.com/questions/301809/workarounds-for-nameof-operator-in-c-typesafe-databinding">workarounds for nameof() operator in C#: typesafe databinding</a></li> <li><a href="http://blog.ploeh.dk/2009/08/06/AFluentInterfaceForTestingINotifyPropertyChanged.aspx" rel="nofollow noreferrer">A Fluent Interface For Testing INotifyPropertyChanged</a></li> <li><a href="http://classtester.codeplex.com/" rel="nofollow noreferrer">Automatic Class Tester</a> will test all simple proptites and INotifyPropertyChanged</li> </ul> <hr> <p>I have put a bounty on this question, as someone must have thought hard about the problem and come up with soltions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload