Adding latlon and bounds tests. These may need to change if we decide to switch to "Lon,Lat" ordering for GIS

correctness over language semantics.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@22 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-13 01:27:31 +00:00
parent 29c62da8ee
commit 8bb245832c
3 changed files with 48 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
<ul id="testlist">
<li>test_Control.html</li>
<li>test_LatLon.html</li>
<li>test_Pixel.html</li>
<li>test_Bounds.html</li>
<li>test_Layer.html</li>
<li>test_Map.html</li>
<li>test_Pixel.html</li>
<li>test_Control.html</li>
</ul>

26
tests/test_Bounds.html Normal file
View File

@@ -0,0 +1,26 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var bounds;
function test_01_Bounds_constructor (t) {
t.plan( 5 );
bounds = new OpenLayers.Bounds(1,2,3,4);
t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
t.eq( bounds.minlat, 1, "bounds.minlat is set correctly" );
t.eq( bounds.minlon, 2, "bounds.minlon is set correctly" );
t.eq( bounds.maxlat, 3, "bounds.maxlat is set correctly" );
t.eq( bounds.maxlon, 4, "bounds.maxlon is set correctly" );
}
function test_02_Bounds_toBBOX(t) {
t.plan( 1 );
t.eq( bounds.toBBOX(), "2,1,4,3", "toBBOX() returns correct value." )
}
// -->
</script>
</head>
<body>
</body>
</html>

18
tests/test_LatLon.html Normal file
View File

@@ -0,0 +1,18 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var latlon;
function test_01_LatLon_constructor (t) {
t.plan( 3 );
latlon = new OpenLayers.LatLon(5,6);
t.ok( latlon instanceof OpenLayers.LatLon, "new OpenLayers.LatLon returns LatLon object" );
t.eq( latlon.lat, 5, "latlon.lat is set correctly");
t.eq( latlon.lon, 6, "latlon.lon is set correctly");
}
// -->
</script>
</head>
<body>
</body>
</html>