Skip to content

Commit 7fdda80

Browse files
Merge pull request #32 from ThalesGroup/dev-boundingbox
Add valid test on BoundingBox + unit test
2 parents f1be896 + a1dbb5d commit 7fdda80

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/GeoTools-Tests/GeoToolsBoundingBoxTest.class.st

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,21 @@ GeoToolsBoundingBoxTest >> testCenterAbsoluteCoordinates [
153153
self assert: boundingBox centerAbsoluteCoordinates longitudeInDegrees equals: 0.
154154
]
155155

156+
{ #category : #tests }
157+
GeoToolsBoundingBoxTest >> testIsValid [
158+
159+
self deny: boundingBox isValid.
160+
161+
self setUpZeroBox.
162+
self assert: boundingBox isValid.
163+
164+
self setUpSmallBox.
165+
self assert: boundingBox isValid.
166+
167+
self setUpTopRightSmallBox.
168+
self assert: boundingBox isValid
169+
]
170+
156171
{ #category : #tests }
157172
GeoToolsBoundingBoxTest >> testLeftLongitudeInDegrees [
158173

src/GeoTools/TGeoToolsBoundingBox.trait.st

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ TGeoToolsBoundingBox >> centerAbsoluteCoordinates [
9090
longitudeInDegrees: longitude
9191
]
9292

93+
{ #category : #testing }
94+
TGeoToolsBoundingBox >> isValid [
95+
96+
^ (self topLeftAbsoluteCoordinates notNil and: [
97+
self topLeftAbsoluteCoordinates isValid ]) and: [
98+
self bottomRightAbsoluteCoordinates notNil and: [
99+
self bottomRightAbsoluteCoordinates isValid ] ]
100+
]
101+
93102
{ #category : #accessing }
94103
TGeoToolsBoundingBox >> leftLongitudeInDegrees [
95104

0 commit comments

Comments
 (0)