-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocations_test.go
49 lines (39 loc) · 949 Bytes
/
locations_test.go
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
package totoro
import (
"testing"
)
func Test_GetLocations(t *testing.T) {
locations, err := GetLocations()
if err != nil {
t.Error(err)
}
if len(locations) > 10 {
t.Log("Passed geting locations")
} else {
t.Error("Failed to get locations")
}
//Skipping for now, limit doesn't seem to work on this endpoint
locationLimit, limitErr := GetLocations(map[string]string{
"limit": "5",
})
t.Skip("Skipping the get location by limit, currently not working from API")
if limitErr != nil {
t.Error(limitErr)
}
if len(locationLimit) == 5 {
t.Log("Passed get locations with limit")
} else {
t.Error("Failed to get locations with limit")
}
}
func Test_GetLocationByID(t *testing.T) {
location, err := GetLocationByID("11014596-71b0-4b3e-b8c0-1c4b15f28b9a")
if err != nil {
t.Error(err)
}
if location.Name == "Irontown" {
t.Log("Passed get location by id")
} else {
t.Error("Failed to get location by id")
}
}