This repository was archived by the owner on Jan 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwavemodel_test.go
More file actions
59 lines (49 loc) · 1.46 KB
/
wavemodel_test.go
File metadata and controls
59 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package surfnerd
import (
"testing"
)
func TestEastCoastWaveModelLocations(t *testing.T) {
eastCoastModel := NewEastCoastWaveModel()
// Check if the East Coast model contains RI, FL, etc..
riLocation := NewLocationForLatLong(41.336872, 288.635294)
riAssert := eastCoastModel.ContainsLocation(riLocation)
if !riAssert {
t.Failed()
}
flLocation := NewLocationForLatLong(30.503731, 278.689821)
flAssert := eastCoastModel.ContainsLocation(flLocation)
if !flAssert {
t.Failed()
}
// Check the RI index for the location
riLatIndex, riLngIndex := eastCoastModel.LocationIndices(riLocation)
if riLatIndex > 249 || riLatIndex < 246 {
t.Failed()
}
if riLngIndex > 172 || riLngIndex < 171 {
t.Failed()
}
}
func TestWestCoastWaveModelLocations(t *testing.T) {
westCoastModel := NewWestCoastWaveModel()
// Check if the West coast model contains SF, LA, etc
sfLocation := NewLocationForLatLong(37.746555, 237.449909)
sfAssert := westCoastModel.ContainsLocation(sfLocation)
if !sfAssert {
t.Failed()
}
laLocation := NewLocationForLatLong(33.902491, 241.566714)
laAssert := westCoastModel.ContainsLocation(laLocation)
if !laAssert {
t.Failed()
}
}
func TestPacificIslandsModelLocations(t *testing.T) {
pacificIslandsModel := NewPacificIslandsWaveModel()
// Check to make sure HI locations are included
hiLocation := NewLocationForLatLong(21.27791, 202.149663)
hiAssert := pacificIslandsModel.ContainsLocation(hiLocation)
if !hiAssert {
t.Failed()
}
}