-
Notifications
You must be signed in to change notification settings - Fork 0
/
worldbosses_test.go
51 lines (47 loc) · 1.26 KB
/
worldbosses_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
package gw2api_test
import (
"testing"
"atomys.codes/gw2api-go"
)
func TestRequestor_WorldBoss(t *testing.T) {
type args struct {
worldBoss gw2api.WorldBoss
id string
}
tests := []struct {
name string
requestor *gw2api.Requestor
args args
wantErr bool
}{
{"worldBoss with correct id", gw2api.NewRequestor(), args{gw2api.WorldBoss{}, "the_shatterer"}, false},
{"worldBoss with invalid id", gw2api.NewRequestor(), args{gw2api.WorldBoss{}, "a_fuckin_barrel"}, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.requestor.WorldBoss(&tt.args.worldBoss, tt.args.id).Err(); (got != nil) != tt.wantErr {
t.Errorf("Requestor.World() = %v, want error %v", got, tt.wantErr)
}
})
}
}
func TestRequestor_WorldBosses(t *testing.T) {
type args struct {
worldBosses []string
}
tests := []struct {
name string
requestor *gw2api.Requestor
args args
wantErr bool
}{
{"WorldBosses", gw2api.NewRequestor(), args{[]string{}}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.requestor.WorldBosses(&tt.args.worldBosses).Err(); (got != nil) != tt.wantErr {
t.Errorf("Requestor.World() = %v, want error %v", got, tt.wantErr)
}
})
}
}