Add tile tests. Next to do is to figure out how to set up tests for subclasses... should they go in the parent level test object, or in a seperate test object?

git-svn-id: http://svn.openlayers.org/trunk/openlayers@88 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-17 12:24:08 +00:00
parent 66edc6dcb7
commit fad697dc5a
2 changed files with 31 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
<li>test_Bounds.html</li>
<li>test_Events.html</li>
<li>test_Layer.html</li>
<li>test_Tile.html</li>
<li>test_Control.html</li>
<li>test_Map.html</li>
</ul>

30
tests/test_Tile.html Normal file
View File

@@ -0,0 +1,30 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var tile;
function test_01_Tile_constructor (t) {
t.plan( 9 );
tile = new OpenLayers.Tile(
new OpenLayers.Bounds(1,2,3,4), "",
new OpenLayers.Size(5,6));
t.ok( tile instanceof OpenLayers.Tile, "new OpenLayers.Tile returns Tile object" );
t.ok( tile.bounds instanceof OpenLayers.Bounds, "tile.bounds is a Bounds object" );
t.eq( tile.bounds.minlat, 1, "tile.bounds.minlat is set correctly");
t.eq( tile.bounds.maxlat, 3, "tile.bounds.maxlat is set correctly");
t.eq( tile.bounds.minlon, 2, "tile.bounds.minlon is set correctly");
t.eq( tile.bounds.maxlon, 4, "tile.bounds.maxlon is set correctly");
t.ok( tile.size instanceof OpenLayers.Size, "tile.size is a Size object" );
t.eq( tile.size.w, 5, "tile.size.w is set correctly");
t.eq( tile.size.h, 6, "tile.size.h is set correctly");
}
// -->
</script>
</head>
<body>
</body>
</html>