-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiban_test.go
74 lines (69 loc) · 1.57 KB
/
apiban_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
package main
import (
"testing"
)
var CASBAN_BAD_ID = 5582880245
var LOLSBOT_BAD_ID = 6656436060
var GOOD_ID = 5485817729
func Test_isUserApiBanned(t *testing.T) {
type args struct {
userid int
}
tests := []struct {
name string
args args
want bool
}{
{"All_CasBanTrue", args{userid: CASBAN_BAD_ID}, true},
{"All_CasBanFalse", args{userid: GOOD_ID}, false},
{"All_LolsBanTrue", args{userid: LOLSBOT_BAD_ID}, true},
{"All_LolsBanFalse", args{userid: GOOD_ID}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isUserApiBanned(tt.args.userid); got != tt.want {
t.Errorf("isUserApiBanned() = %v, want %v", got, tt.want)
}
})
}
}
func Test_isUserCasBanned(t *testing.T) {
type args struct {
userid int
}
tests := []struct {
name string
args args
want bool
}{
{"CasBanTrue", args{userid: CASBAN_BAD_ID}, true},
{"CasBanFalse", args{userid: GOOD_ID}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isUserCasBanned(tt.args.userid); got != tt.want {
t.Errorf("isUserCasBanned() = %v, want %v", got, tt.want)
}
})
}
}
func Test_isUserLolsBanned(t *testing.T) {
type args struct {
userid int
}
tests := []struct {
name string
args args
want bool
}{
{"LolsBanTrue", args{userid: LOLSBOT_BAD_ID}, true},
{"LolsBanFalse", args{userid: GOOD_ID}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isUserLolsBanned(tt.args.userid); got != tt.want {
t.Errorf("isUserLolsBanned() = %v, want %v", got, tt.want)
}
})
}
}