Provides for tests

This commit is contained in:
Tim Schaub
2013-02-19 23:15:45 -07:00
parent 438664a190
commit 083404bd58
6 changed files with 36 additions and 18 deletions

View File

@@ -1,11 +1,13 @@
goog.provide('ol.test.geom.MultiLineString');
describe('ol.geom.MultiLineString', function() {
describe('constructor', function() {
it('creates a multi-linestring from an array', function() {
var multi = new ol.geom.MultiLineString([
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
expect(multi).toBeA(ol.geom.MultiLineString);
});
@@ -21,8 +23,8 @@ describe('ol.geom.MultiLineString', function() {
it('is an array of linestrings', function() {
var multi = new ol.geom.MultiLineString([
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
expect(multi.components.length).toBe(2);
expect(multi.components[0]).toBeA(ol.geom.LineString);
@@ -36,15 +38,15 @@ describe('ol.geom.MultiLineString', function() {
it('can be 2', function() {
var multi = new ol.geom.MultiLineString([
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
expect(multi.dimension).toBe(2);
});
it('can be 3', function() {
var multi = new ol.geom.MultiLineString([
[[10, 20, 30], [30, 40, 50]],
[[20, 30, 40], [40, 50, 60]]]);
[[10, 20, 30], [30, 40, 50]],
[[20, 30, 40], [40, 50, 60]]]);
expect(multi.dimension).toBe(3);
});
@@ -54,8 +56,8 @@ describe('ol.geom.MultiLineString', function() {
it('returns the bounding extent', function() {
var multi = new ol.geom.MultiLineString([
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
var bounds = multi.getBounds();
expect(bounds.minX).toBe(10);
expect(bounds.minY).toBe(20);
@@ -67,3 +69,4 @@ describe('ol.geom.MultiLineString', function() {
});
goog.require('ol.geom.MultiLineString');