forked from andersfylling/disgord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_test.go
51 lines (40 loc) · 1.08 KB
/
user_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
// +build !integration
package disgord
import (
"fmt"
"testing"
)
func TestUserPresence_InterfaceImplementations(t *testing.T) {
var u interface{} = &UserPresence{}
t.Run("Stringer", func(t *testing.T) {
if _, ok := u.(fmt.Stringer); !ok {
t.Error("UserPresence does not implement fmt.Stringer")
}
})
t.Run("DeepCopier", func(t *testing.T) {
if _, ok := u.(DeepCopier); !ok {
t.Error("UserPresence does not implement DeepCopier")
}
})
t.Run("Copier", func(t *testing.T) {
if _, ok := u.(Copier); !ok {
t.Error("UserPresence does not implement Copier")
}
})
}
func TestGetCurrentUserGuildsParams(t *testing.T) {
params := &getCurrentUserGuildsBuilder{}
params.r.setup(nil, nil, nil)
var wants string
wants = ""
verifyQueryString(t, params.r.urlParams, wants)
wants = "?before=438543957"
params.SetBefore(438543957)
verifyQueryString(t, params.r.urlParams, wants)
wants += "&limit=6"
params.SetLimit(6)
verifyQueryString(t, params.r.urlParams, wants)
wants = "?before=438543957"
params.SetDefaultLimit()
verifyQueryString(t, params.r.urlParams, wants)
}