Thursday, September 1, 2011

Re: How to mock Listbox when testing the Presenter class?

It won't; it only talks to the view through the Display interface (or possibly if it's really complex, through sub-objects, but try as hard as possible to keep them seen as interfaces or mockable objects –i.e. objects that you can extend to remove all JSNI dependency– or you'll need a, sluggish, GWTTestCase).

(to quickly answer your previous message, which I didn't read 'til the end, it doesn't really matter how your view is implemented, what matters is how your presenter talks to it, the granularity of the "protocol"/contract impacting how much code you can unit-test without a GWTTestCase: the more code in the presenter, the more code can be tested without GWTTestCase, but also the more complex the presenter, which makes it less readable and maintainable)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/7Lq-tO0MGSUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment