On Wednesday, October 26, 2011 3:51:12 PM UTC+2, tanteanni wrote:
i guess you mean to implement my own PlaceHistoryMapper - only for test?
that could work
Yes, with the added benefit that you could test whether you call the PlaceHistoryMapper with the appropriate argument, not whether the returned value from the place-to-string conversion is the one you expect (which will change when you change your PlaceTokenizer, but you're not testing your PlaceTokenizer here, you're testing your activity, and if the test changes when the implementation of another class changes –without breaking the contract: turn a place into a string–, it's no longer a *unit* test; and it also means you'd have to change all your tests when you decide to change what your PlaceTokenizer generates/parses).
With a mock, the exact output wouldn't matter, the input would however: does my activity calls the mapper with the appropriate argument?
but now i am happy with my getPrefix() in place-class. With this i don't need a dependency to historymapper in my activity. (it don't feels right to use historymapper to get a constant string from a place?!)
Well, the goal of PlaceHistoryMapper *is* to get a string out of a place (and the reverse). Whether it's used by the PlaceHistoryHandler or your code the builds link doesn't really matter.
-- 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/-/kYVjqqZJVPgJ.
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