Bounds spec.
This commit is contained in:
@@ -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>
|
||||
|
||||
33
test/spec/ol/Bounds.test.js
Normal file
33
test/spec/ol/Bounds.test.js
Normal 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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user