-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums_test.go
66 lines (57 loc) · 2.83 KB
/
enums_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
package pubnub
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPushString(t *testing.T) {
assert := assert.New(t)
pushAPNS := PNPushTypeAPNS
pushMPNS := PNPushTypeMPNS
pushGCM := PNPushTypeGCM
pushNONE := PNPushTypeNone
assert.Equal("apns", pushAPNS.String())
assert.Equal("mpns", pushMPNS.String())
assert.Equal("gcm", pushGCM.String())
assert.Equal("none", pushNONE.String())
}
func TestStatusCategoryString(t *testing.T) {
assert := assert.New(t)
assert.Equal("Unknown", PNUnknownCategory.String())
assert.Equal("Timeout", PNTimeoutCategory.String())
assert.Equal("Connected", PNConnectedCategory.String())
assert.Equal("Disconnected", PNDisconnectedCategory.String())
assert.Equal("Cancelled", PNCancelledCategory.String())
assert.Equal("Loop Stop", PNLoopStopCategory.String())
assert.Equal("Acknowledgment", PNAcknowledgmentCategory.String())
assert.Equal("Bad Request", PNBadRequestCategory.String())
assert.Equal("Access Denied", PNAccessDeniedCategory.String())
assert.Equal("Reconnected", PNReconnectedCategory.String())
assert.Equal("Reconnection Attempts Exhausted", PNReconnectionAttemptsExhausted.String())
assert.Equal("No Stub Matched", PNNoStubMatchedCategory.String())
}
func TestOperationTypeString(t *testing.T) {
assert := assert.New(t)
assert.Equal("Subscribe", PNSubscribeOperation.String())
assert.Equal("Unsubscribe", PNUnsubscribeOperation.String())
assert.Equal("Publish", PNPublishOperation.String())
assert.Equal("Fire", PNFireOperation.String())
assert.Equal("History", PNHistoryOperation.String())
assert.Equal("Fetch Messages", PNFetchMessagesOperation.String())
assert.Equal("Where Now", PNWhereNowOperation.String())
assert.Equal("Here Now", PNHereNowOperation.String())
assert.Equal("Heartbeat", PNHeartBeatOperation.String())
assert.Equal("Set State", PNSetStateOperation.String())
assert.Equal("Get State", PNGetStateOperation.String())
assert.Equal("Add Channel To Channel Group", PNAddChannelsToChannelGroupOperation.String())
assert.Equal("Remove Channel From Channel Group", PNRemoveChannelFromChannelGroupOperation.String())
assert.Equal("Remove Channel Group", PNRemoveGroupOperation.String())
assert.Equal("List Channels In Channel Group", PNChannelsForGroupOperation.String())
assert.Equal("List Push Enabled Channels", PNPushNotificationsEnabledChannelsOperation.String())
assert.Equal("Add Push From Channel", PNAddPushNotificationsOnChannelsOperation.String())
assert.Equal("Remove Push From Channel", PNRemovePushNotificationsFromChannelsOperation.String())
assert.Equal("Remove All Push Notifications", PNRemoveAllPushNotificationsOperation.String())
assert.Equal("Time", PNTimeOperation.String())
assert.Equal("Grant", PNAccessManagerGrant.String())
assert.Equal("Revoke", PNAccessManagerRevoke.String())
assert.Equal("Delete messages", PNDeleteMessagesOperation.String())
}