P&P Summit Day Three: Presenting the Model

The first session after lunch today was presented by Brad Wilson. It looks like Brad wins the number of presentations award, he’s presenting three times over the week. Brad is going to talk about doing Test Driven Development with complex UIs. He’s going to be talking about the MVP pattern and how this will help provide the hooks to test right up to the UI, but not really the actual UI. (bummer)

Brad defines the “Model” as the data of your application. He defines the “View” as your ability to visualize and edit the model. The “Presenter” acts as the gateway between the model and view. Unlike MVC pattern where everyone talks to everyone, in MVP the view talks to the presenter only and does not talk to the model at all, everything goes through the presenter.

Brad then starts down a description and example of the MVP pattern. I’d suggest checking out more data on this via MSDN.

While writing some sample tests Brad makes one of his class fields protected in his presenter. He does this specifically so that he can inherit from that class and then expose the field for tests. I wonder if the InternalsVisibleTo would handle this as well.

At the end of a really long demo he ends with a view that had nothing but winform code in it. This is what you want. The presenter and the model can be tested via the Unit Tests, while the view is tested by your QA team.

Good talk, but I was already familiar with this information.