-
Notifications
You must be signed in to change notification settings - Fork 35
/
usergroup_test.go
73 lines (55 loc) · 1.08 KB
/
usergroup_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
package weixin
import "testing"
func TestCreateUserGroup(t *testing.T) {
g, err := CreateUserGroup("test")
if err != nil {
t.Log(err)
t.FailNow()
}
t.Logf("%#v", g)
}
func TestUpdateUserGroup(t *testing.T) {
g, err := UpdateUserGroup(100, "test2")
if err != nil {
t.Log(err)
t.FailNow()
}
t.Logf("%#v", g)
}
func TestGetAllUserGroups(t *testing.T) {
gs, err := GetAllUserGroups()
if err != nil {
t.Log(err)
t.FailNow()
}
t.Logf("%#v", gs)
}
func TestGetGroupIdByOpenId(t *testing.T) {
g, err := GetGroupIdByOpenId("ozmLcjnM7vnrXmb3DimFLi0EOiY8")
if err != nil {
t.Log(err)
t.FailNow()
}
t.Logf("%#v", g)
}
func TestUpdateMemberGroup(t *testing.T) {
err := UpdateMemberGroup("ozmLcjnM7vnrXmb3DimFLi0EOiY8", 102)
if err != nil {
t.Log(err)
t.FailNow()
}
}
func TestBatchUpdateMemberGroup(t *testing.T) {
err := BatchUpdateMemberGroup([]string{"ozmLcjnM7vnrXmb3DimFLi0EOiY8"}, 100)
if err != nil {
t.Log(err)
t.FailNow()
}
}
func TestDeleteUserGroup(t *testing.T) {
err := DeleteUserGroup(101)
if err != nil {
t.Log(err)
t.FailNow()
}
}