Ejemplo n.º 1
0
        public void sendSimpleNotification_Pall_Ndefault()
        {
            PushPayload payload = PushPayload.AlertAll("Pall Nall default alert");
            var         result  = _client.SendPush(payload);

            Assert.IsTrue(result.isResultOK());
        }
Ejemplo n.º 2
0
        public void test_validate()
        {
            JPushClient pushClient = new JPushClient(APP_KEY, MASTER_SECRET);

            try
            {
                var result = pushClient.SendPush(PushPayload.AlertAll("alert"));
                Assert.IsTrue(result.isResultOK());
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
Ejemplo n.º 3
0
        public void authenticationFail()
        {
            String      masterSecret = "2b38ce69b1de2a7fa95706e2";
            JPushClient client       = new JPushClient(masterSecret, APP_KEY);
            PushPayload payload      = PushPayload.AlertAll(ALERT);

            try
            {
                var result = _client.SendPush(payload);
            }
            catch (APIRequestException e)
            {
                Assert.AreEqual(AUTHENTICATION_FAIL, e.ErrorCode);
            }
        }
Ejemplo n.º 4
0
        public void appKeyNotExist()
        {
            String      appKey  = "dd1066407b044738b6479274";
            JPushClient client  = new JPushClient(appKey, MASTER_SECRET);
            PushPayload payload = PushPayload.AlertAll(ALERT);

            try
            {
                var result = _client.SendPush(payload);
            }
            catch (APIRequestException e)
            {
                Assert.AreEqual(APPKEY_NOT_EXIST, e.ErrorCode);
            }
        }