From ba7b54949cbcf898ada43398bdee90b691199b88 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 21 Jun 2012 18:09:36 +0200 Subject: [PATCH] Bounds spec. --- test/index.html | 1 + test/spec/ol/Bounds.test.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/spec/ol/Bounds.test.js diff --git a/test/index.html b/test/index.html index 53d0f6c39d..c29ee04f34 100644 --- a/test/index.html +++ b/test/index.html @@ -61,6 +61,7 @@ + diff --git a/test/spec/ol/Bounds.test.js b/test/spec/ol/Bounds.test.js new file mode 100644 index 0000000000..909ff292b8 --- /dev/null +++ b/test/spec/ol/Bounds.test.js @@ -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); + }); + + }); + +});