First state of a geom package.

This commit is contained in:
Marc Jansen
2012-06-19 18:21:21 +02:00
parent 712070c1f0
commit 450f8f7b74
10 changed files with 384 additions and 1 deletions

View File

@@ -0,0 +1,56 @@
describe("ol.geom.Geometry", function() {
var g;
beforeEach(function() {
g = ol.geom.geometry();
});
afterEach(function() {
g = null;
});
it("constructs instances", function() {
expect(g).toEqual(jasmine.any(ol.geom.Geometry));
console.log(g);
console.log(g.foo);
console.log(g.foo());
});
it("can set bounds", function() {
var oldBounds = g.bounds();
expect(oldBounds).toBeUndefined();
var b = ol.bounds([0,1,2,3]);
g.bounds(b);
var gotBounds = g.bounds();
expect(gotBounds).not.toBeUndefined();
});
it("can get bounds", function() {
var b = ol.bounds([0,1,2,3]);
g.bounds(b);
var gotBounds = g.bounds();
expect(gotBounds).toEqual(jasmine.any(ol.Bounds));
});
it("sets and gets the correct bounds", function() {
var b = ol.bounds([0,1,2,3]);
g.bounds(b);
var gotBounds = g.bounds();
expect(gotBounds.getMinX()).toEqual(0);
expect(gotBounds.getMinY()).toEqual(1);
expect(gotBounds.getMaxX()).toEqual(2);
expect(gotBounds.getMaxY()).toEqual(3);
});
//
});