Esempio n. 1
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            string[] multiChannel = { "testChannel" };
            //
            CurrentRequestType crt              = CurrentRequestType.NonSubscribe;
            string             expectedMessage  = "[[]";
            string             expectedChannels = string.Join(",", multiChannel);
            ResponseType       respType         = ResponseType.Time;

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            long nanoSecondTime = 0;//Pubnub.TranslateDateTimeToPubnubUnixNanoSeconds (DateTime.UtcNow);

            string url = string.Format("http://pubsub.pubnub.com/subscribe/{0}/{1}/0/{2}?uuid={3}&pnsdk={4}", CommonIntergrationTests.SubscribeKey,
                                       expectedChannels, nanoSecondTime, pubnub.SessionUUID, pubnub.Version
                                       );

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            string[] multiChannel = { "testChannel" };

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            CurrentRequestType crt              = CurrentRequestType.PresenceHeartbeat;
            string             expectedMessage  = "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}";
            string             expectedChannels = string.Join(",", multiChannel);
            string             url              = string.Format("http://ps.pndsn.com/v2/presence/sub_key/{0}/channel/{1}/heartbeat?uuid={2}&heartbeat=62&pnsdk={3}", CommonIntergrationTests.SubscribeKey,
                                                                expectedChannels, pubnub.SessionUUID, pubnub.Version
                                                                );
            ResponseType respType = ResponseType.PresenceHeartbeat;

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string url = "https://pubsub.pubnub.com/time/0";

            string[] multiChannel = { "testChannel" };
            //
            CurrentRequestType crt              = CurrentRequestType.NonSubscribe;
            string             expectedMessage  = "[14";
            string             expectedChannels = string.Join(",", multiChannel);
            ResponseType       respType         = ResponseType.Time;

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }