Bounds spec.

This commit is contained in:
Tim Schaub
2012-06-21 18:09:36 +02:00
parent 7f7528baf9
commit ba7b54949c
2 changed files with 34 additions and 0 deletions

View File

@@ -61,6 +61,7 @@
<script type="text/javascript" src="spec/ol/Events.test.js"></script>
<script type="text/javascript" src="spec/ol/UnreferencedBounds.test.js"></script>
<script type="text/javascript" src="spec/ol/Projection.test.js"></script>
<script type="text/javascript" src="spec/ol/Bounds.test.js"></script>
<script type="text/javascript" src="spec/ol/Tile.test.js"></script>
<script type="text/javascript" src="spec/ol/TileSet.test.js"></script>
<script type="text/javascript" src="spec/ol/TileCache.test.js"></script>

View File

@@ -0,0 +1,33 @@
describe("ol.Bounds", function() {
describe("creating a bounds", function() {
it("creates a bounds instance", function() {
var bounds = new ol.Bounds(1, 2, 3, 4);
expect(bounds).toBeA(ol.Bounds);
});
});
describe("getting properties", function() {
var bounds = new ol.Bounds(10, 20, 30, 50);
it("allows getting width", function() {
expect(bounds.getWidth()).toBe(20);
});
it("allows getting height", function() {
expect(bounds.getHeight()).toBe(30);
});
it("allows getting null projection", function() {
expect(bounds.getProjection()).toBeNull();
});
it("allws getting a projection", function() {
var proj = new ol.Projection("EPSG:4326");
var bounds = new ol.Bounds(-180, -90, 180, 90, proj);
expect(bounds.getProjection()).toBe(proj);
});
});
});