-
Notifications
You must be signed in to change notification settings - Fork 11
/
misc_test.go
105 lines (86 loc) · 2.43 KB
/
misc_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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package gw2api
import "testing"
func TestQuaggans(t *testing.T) {
var err error
api := NewGW2Api()
var testQuaggans []string
if testQuaggans, err = api.Quaggans(); err != nil {
t.Error("Failed to fetch quaggans")
}
var quaggans []Quaggan
if quaggans, err = api.QuagganIds(testQuaggans[0:2]...); err != nil {
t.Error("Failed to parse the quaggan data: ", err)
} else if len(quaggans) != 2 {
t.Error("Failed to fetch existing quaggans")
}
}
func TestWorlds(t *testing.T) {
var err error
api := NewGW2Api()
var testWorlds []int
if testWorlds, err = api.Worlds(); err != nil {
t.Error("Failed to fetch worlds")
}
var worlds []World
if worlds, err = api.WorldIds("en", testWorlds[0:2]...); err != nil {
t.Error("Failed to parse the world data: ", err)
} else if len(worlds) != 2 {
t.Error("Failed to fetch existing worlds")
}
}
func TestColors(t *testing.T) {
var err error
api := NewGW2Api()
var testColors []int
if testColors, err = api.Colors(); err != nil {
t.Error("Failed to fetch colors")
}
var colors []Color
if colors, err = api.ColorIds("en", testColors[0:2]...); err != nil {
t.Error("Failed to parse the color data: ", err)
} else if len(colors) != 2 {
t.Error("Failed to fetch existing colors")
}
}
func TestCurrencies(t *testing.T) {
var err error
api := NewGW2Api()
var testCurrencies []int
if testCurrencies, err = api.Currencies(); err != nil {
t.Error("Failed to fetch currencies")
}
var currencies []Currency
if currencies, err = api.CurrencyIds("en", testCurrencies[0:2]...); err != nil {
t.Error("Failed to parse the currency data: ", err)
} else if len(currencies) != 2 {
t.Error("Failed to fetch existing currencies")
}
}
func TestFiles(t *testing.T) {
var err error
api := NewGW2Api()
var testFiles []string
if testFiles, err = api.Files(); err != nil {
t.Error("Failed to fetch files")
}
var files []File
if files, err = api.FileIds(testFiles[0:2]...); err != nil {
t.Error("Failed to parse the file data: ", err)
} else if len(files) != 2 {
t.Error("Failed to fetch existing files")
}
}
func TestMinis(t *testing.T) {
var err error
api := NewGW2Api()
var testMinis []int
if testMinis, err = api.Minis(); err != nil {
t.Error("Failed to fetch minis")
}
var minis []Mini
if minis, err = api.MiniIds("en", testMinis[0:2]...); err != nil {
t.Error("Failed to parse the mini data: ", err)
} else if len(minis) != 2 {
t.Error("Failed to fetch existing minis")
}
}