-
Notifications
You must be signed in to change notification settings - Fork 3
/
registerservice_test.go
96 lines (83 loc) · 2.25 KB
/
registerservice_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
package goPushSdk
import (
"fmt"
"testing"
)
func printMessage(message string) {
fmt.Println("current message " + message)
}
func TestGetRegisterSwitch(t *testing.T) {
message := GetRegisterSwitch(APP_ID, PUSH_ID, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestChangeRegisterSwitch(t *testing.T) {
message := ChangeRegisterSwitch(APP_ID, PUSH_ID, NOTIFICATION_SWITCH, false, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
message1 := ChangeRegisterSwitch(APP_ID, PUSH_ID, THROUGH_MESSAGE_SWITCH, false, APP_KEY)
printMessage(message1.message)
if message1.code != 200 {
t.Error("Status Code not 200")
}
}
func TestChangeAllSwitch(t *testing.T) {
message := ChangeAllSwitch(APP_ID, PUSH_ID, false, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestSubscribeAlias(t *testing.T) {
message := SubscribeAlias(APP_ID, PUSH_ID, "go-push", APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestUnSubscribeAlias(t *testing.T) {
message := UnSubscribeAlias(APP_ID, PUSH_ID, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestGetSubAlias(t *testing.T) {
message := GetSubAlias(APP_ID, PUSH_ID, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestSubscribeTags(t *testing.T) {
message := SubscribeTags(APP_ID, PUSH_ID, "go-push-tag1,go-push-tag2", APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestUnSubscribeTags(t *testing.T) {
message := UnSubscribeTags(APP_ID, PUSH_ID, "go-push-tag1", APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestGetSubTags(t *testing.T) {
message := GetSubTags(APP_ID, PUSH_ID, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestUnSubAllTags(t *testing.T) {
message := UnSubAllTags(APP_ID, PUSH_ID, APP_KEY)
printMessage(message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}