Unit testing classes extending google maps' classes

56 views
Skip to first unread message

Piotr Sarnacki

unread,
Oct 30, 2009, 6:36:30 AM10/30/09
to Google Maps JavaScript API v3
Hi,

As there is no TileOverlay in google maps version 3 I wrote my own and
I would like to add unit tests for it. It is extending OverlayView:
TileOverlay.prototype = new google.maps.OverlayView();

It takes map as one of the options and then does this.set_map
(options.map). Is it ok if I will actually load google map? Or should
mock google map element in some way?

I know that from the theoretical I should mock it, to test code in
isolation, but sometimes the more convenient way is to use some real
parts of the system. How do you solve that problem in practice?

Piotr Sarnacki

unread,
Oct 30, 2009, 6:54:43 AM10/30/09
to Google Maps JavaScript API v3


> I know that from the theoretical I should mock it

Theoretical point of view* :)
Reply all
Reply to author
Forward
0 new messages