-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #2189
- Loading branch information
Showing
4 changed files
with
497 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
define([ | ||
"../../../../../../../../src/js/models/maps/GeoPoint", | ||
], function (GeoPoint) { | ||
// Configure the Chai assertion library | ||
var should = chai.should(); | ||
var expect = chai.expect; | ||
|
||
describe("GeoPoint Test Suite", function () { | ||
/* Set up */ | ||
beforeEach(function () {}); | ||
|
||
/* Tear down */ | ||
afterEach(function () {}); | ||
|
||
describe("Initialization", function () { | ||
it("should create a GeoPoint instance", function () { | ||
new GeoPoint().should.be.instanceof(GeoPoint); | ||
}); | ||
}); | ||
|
||
describe("Validation", function () { | ||
it("should validate a valid GeoPoint", function () { | ||
var point = new GeoPoint({ | ||
latitude: 0, | ||
longitude: 0, | ||
height: 0 | ||
}); | ||
point.isValid().should.be.true; | ||
}); | ||
|
||
it("should invalidate a GeoPoint with an invalid latitude", function () { | ||
var point = new GeoPoint({ | ||
latitude: 100, | ||
longitude: 0, | ||
height: 0 | ||
}); | ||
point.isValid().should.be.false; | ||
}); | ||
|
||
it("should invalidate a GeoPoint with an invalid longitude", function () { | ||
var point = new GeoPoint({ | ||
latitude: 0, | ||
longitude: 200, | ||
height: 0 | ||
}); | ||
point.isValid().should.be.false; | ||
}); | ||
|
||
it("should invalidate a GeoPoint with an invalid height", function () { | ||
var point = new GeoPoint({ | ||
latitude: 0, | ||
longitude: 0, | ||
height: "foo" | ||
}); | ||
point.isValid().should.be.false; | ||
}); | ||
}); | ||
|
||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
define([ | ||
"../../../../../../../../src/js/models/maps/GeoScale", | ||
], function (GeoScale) { | ||
// Configure the Chai assertion library | ||
var should = chai.should(); | ||
var expect = chai.expect; | ||
|
||
describe("GeoScale Test Suite", function () { | ||
/* Set up */ | ||
beforeEach(function () {}); | ||
|
||
/* Tear down */ | ||
afterEach(function () {}); | ||
|
||
describe("Initialization", function () { | ||
it("should create a GeoScale instance", function () { | ||
new GeoScale().should.be.instanceof(GeoScale); | ||
}); | ||
}); | ||
|
||
describe("Validation", function () { | ||
it("should validate a valid GeoScale", function () { | ||
var scale = new GeoScale({ | ||
pixel: 1, | ||
meters: 1 | ||
}); | ||
scale.isValid().should.be.true; | ||
}); | ||
|
||
it("should invalidate a GeoScale with an invalid pixel scale", function () { | ||
var scale = new GeoScale({ | ||
pixel: -1, | ||
meters: 1 | ||
}); | ||
scale.isValid().should.be.false; | ||
}); | ||
|
||
it("should invalidate a GeoScale with an invalid meters scale", function () { | ||
var scale = new GeoScale({ | ||
pixel: 1, | ||
meters: -1 | ||
}); | ||
scale.isValid().should.be.false; | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.