Structure and testing

This is the part of the course that is proven by running. A form is hard to test; the logic inside it is not, once it leaves the form. These nine lessons move validation, state and persistence into plain classes, put a presenter between them and an interface the form implements, and test the presenter against a fake view with a driver whose exit status is the result. The last two lessons cover resources, accessibility and dotnet format.

051 Why logic leaves the form the three layers, what a test can reach, the cost of a form that owns its logic Open 052 Model-View-Presenter and Passive View an IView interface, a presenter, the flow of one command, run headless Open 053 A fake view and a driver a hand-written fake, assertions, a non-zero exit status, run Open 054 Validation in the presenter rules, the error text the view shows, a table of bad input that runs Open 055 View models INotifyPropertyChanged, computed properties, a view model that runs headless Open 056 Undo and redo a command stack, Do and Undo, the state after three edits, run Open 057 Dependencies by hand constructor injection, a fake clock, a repository seam, run Open 058 Localisation and accessibility resx as code, a JSON translator that runs, AccessibleName, AccessibleRole, AccessibleDescription Open 059 dotnet format on a WinForms project the real clean run and the real exit 2 of a messy file Open

Lessons