Fill out more of Icon and Marker classes. In the XP world, supposedly we test first -- and I actually did in this case. Kind of a nifty trick: you work out what the function is supposed to do solely from the tests you want to write, and then you go and actually write the code that does it.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@87 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-17 12:16:23 +00:00
parent 605ba7a066
commit 66edc6dcb7
5 changed files with 80 additions and 5 deletions

22
tests/test_Icon.html Normal file
View File

@@ -0,0 +1,22 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var icon;
function test_01_Icon_constructor (t) {
t.plan( 5 );
icon = new OpenLayers.Icon("",new OpenLayers.Size(5,6));
t.ok( icon instanceof OpenLayers.Icon, "new OpenLayers.Icon returns Icon object" );
t.ok( icon.size instanceof OpenLayers.Size, "icon.size returns Size object" );
t.eq( icon.size.w, 5, "icon.size.w returns correct value" );
t.eq( icon.size.h, 6, "icon.size.w returns correct value" );
t.eq( icon.url, "", "icon.url returns str object" );
}
// -->
</script>
</head>
<body>
</body>
</html>