Skip to content

Commit 63b67e0

Browse files
Added Tile tests to check for exceptions.
1 parent e8f9b78 commit 63b67e0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Specs/Scene/TileSpec.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
defineSuite([
2+
'Scene/Tile',
3+
'Core/Math'
4+
], function(
5+
Tile,
6+
CesiumMath) {
7+
"use strict";
8+
/*global document,it,expect*/
9+
10+
11+
it("throws without a description", function() {
12+
expect(function() {
13+
return new Tile();
14+
}).toThrow();
15+
});
16+
17+
it("throws without description.extent", function() {
18+
expect(function() {
19+
return new Tile({
20+
x : 0,
21+
y : 0
22+
});
23+
}).toThrow();
24+
});
25+
26+
it("throws without description.zoom", function() {
27+
expect(function() {
28+
return new Tile({
29+
extent : {
30+
north : CesiumMath.PI_OVER_FOUR,
31+
south : 0.0,
32+
east : CesiumMath.PI_OVER_FOUR,
33+
west : -CesiumMath.PI_OVER_FOUR
34+
},
35+
x : 0,
36+
y : 0
37+
});
38+
}).toThrow();
39+
});
40+
41+
it("throws with negative x or y properties", function() {
42+
expect(function() {
43+
return new Tile({
44+
x : -1.0,
45+
y : -1.0,
46+
zoom : 1.0
47+
});
48+
}).toThrow();
49+
});
50+
});

0 commit comments

Comments
 (0)