-
Notifications
You must be signed in to change notification settings - Fork 3
/
non-task-push_test.go
46 lines (35 loc) · 1.15 KB
/
non-task-push_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
package goPushSdk
import (
"fmt"
"testing"
)
func TestPushThroughMessageByPushId(t *testing.T) {
messageJson := `{"test_throught_message": "message"}`
message := PushThroughMessageByPushId(APP_ID, PUSH_ID, buildThroughMessage(messageJson), APP_KEY)
fmt.Println("TestPushThroughMessageByPushId ", message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestPushNotificationMessageByPushId(t *testing.T) {
json := BuildNotificationMessage().
noticeBarType(2).
noticeTitle("标题go").
noticeContent("测试内容").toJson()
message := PushNotificationMessageByPushId(APP_ID, PUSH_ID, json, APP_KEY)
fmt.Println("TestPushNotificationMessageByPushId ", message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}
func TestPushNotificationMessageByAlias(t *testing.T) {
json := BuildNotificationMessage().
noticeBarType(2).
noticeTitle("标题").
noticeContent("测试内容").toJson()
message := PushNotificationMessageByAlias(APP_ID, "Android", json, APP_KEY)
fmt.Println("TestPushNotificationMessageByAlias ", message.message)
if message.code != 200 {
t.Error("Status Code not 200")
}
}