当前位置: 首页>>代码示例>>C#>>正文


C# Pubnub.detailedHistory方法代码示例

本文整理汇总了C#中Pubnub.detailedHistory方法的典型用法代码示例。如果您正苦于以下问题:C# Pubnub.detailedHistory方法的具体用法?C# Pubnub.detailedHistory怎么用?C# Pubnub.detailedHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pubnub的用法示例。


在下文中一共展示了Pubnub.detailedHistory方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ThenUnencryptPublishShouldReturnSuccessCodeAndInfo

        public void ThenUnencryptPublishShouldReturnSuccessCodeAndInfo()
        {
            isUnencryptPublished = false;
            Pubnub pubnub = new Pubnub("demo","demo","","",false);
            PubnubUnitTest unitTest = new PubnubUnitTest();
            unitTest.TestClassName = "WhenAMessageIsPublished";
            unitTest.TestCaseName = "ThenUnencryptPublishShouldReturnSuccessCodeAndInfo";
            pubnub.PubnubUnitTest = unitTest;
            string channel = "my/channel";
            string message = messageForUnencryptPublish;

            pubnub.publish<string>(channel, message, ReturnSuccessUnencryptPublishCodeCallback);
            manualEvent1.WaitOne(310*1000);

            if (!isUnencryptPublished)
            {
                Assert.IsTrue(isUnencryptPublished, "Unencrypt Publish Failed");
            }
            else
            {
                pubnub.detailedHistory<string>(channel, -1, unEncryptPublishTimetoken, -1, false, CaptureUnencryptDetailedHistoryCallback);
                mreUnencryptDH.WaitOne(310 * 1000);
                Assert.IsTrue(isUnencryptDH, "Unable to match the successful unencrypt Publish");
            }
        }
开发者ID:sevco777,项目名称:pubnub-api,代码行数:25,代码来源:WhenAMessageIsPublished.cs

示例2: DetailHistoryCount10ReverseTrueReturnsRecords

        public void DetailHistoryCount10ReverseTrueReturnsRecords()
        {
            msg10ReverseTrueReceived = false;

            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
            string channel = "my/channel";

            pubnub.detailedHistory<string>(channel, -1, -1, 10, true, DetailedHistoryCount10ReverseTrueCallback);
            mreMsgCount10ReverseTrue.WaitOne(310 * 1000);
            Assert.IsTrue(msg10ReverseTrueReceived, "Detailed History Failed");
        }
开发者ID:hart404,项目名称:pubnub-api,代码行数:11,代码来源:WhenDetailedHistoryIsRequested.cs

示例3: DetailHistoryCount10ReverseTrueReturnsRecords

        public void DetailHistoryCount10ReverseTrueReturnsRecords()
        {
            msg10ReverseTrueReceived = false;

            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
            string channel = "my/channel";

            EnqueueCallback(() => pubnub.detailedHistory<string>(channel, -1, -1, 10, true, DetailedHistoryCount10ReverseTrueCallback));
            EnqueueConditional(() => isDetailedHistoryReverse);
            EnqueueCallback(() => Assert.IsTrue(msg10ReverseTrueReceived, "Detailed History Failed"));

            EnqueueTestComplete();
        }
开发者ID:hellogurus,项目名称:pubnub-api,代码行数:13,代码来源:WhenDetailedHistoryIsRequested.cs

示例4: ItShouldReturnDetailedHistory

        public void ItShouldReturnDetailedHistory()
        {
            Pubnub pubnub = new Pubnub(
                "demo",
                "demo",
                "",
                "",
                false
            );
            string channel = "my_channel";

            pubnub.detailedHistory(channel, 100, DisplayDetailedHistory);
        }
开发者ID:eluechin,项目名称:pubnub-api,代码行数:13,代码来源:WhenDetailedHistoryIsRequested.cs

示例5: ItShouldReturnDetailedHistory

        public void ItShouldReturnDetailedHistory()
        {
            Pubnub pubnub = new Pubnub(
                "demo",
                "demo",
                "",
                "",
                false
            );
            string channel = "hello_world";

            pubnub.PropertyChanged += new PropertyChangedEventHandler(Pubnub_PropertyChanged);
            pubnub.detailedHistory(channel, 100);
        }
开发者ID:netcon-source,项目名称:pubnub-api,代码行数:14,代码来源:WhenDetailedHistoryIsRequested.cs

示例6: DetailHistoryCount10ReturnsRecords

        public void DetailHistoryCount10ReturnsRecords()
        {
            msg10Received = false;

            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);

            PubnubUnitTest unitTest = new PubnubUnitTest();
            unitTest.TestClassName = "WhenDetailedHistoryIsRequested";
            unitTest.TestCaseName = "DetailHistoryCount10ReturnsRecords";

            pubnub.PubnubUnitTest = unitTest;

            string channel = "my/channel";

            pubnub.detailedHistory<string>(channel, 10, DetailedHistoryCount10Callback);
            mreMsgCount10.WaitOne(310 * 1000);
            Assert.IsTrue(msg10Received, "Detailed History Failed");
        }
开发者ID:sevco777,项目名称:pubnub-api,代码行数:18,代码来源:WhenDetailedHistoryIsRequested.cs

示例7: DetailedHistoryStartWithReverseTrue

        public void DetailedHistoryStartWithReverseTrue()
        {
            expectedCountAtStartTimeWithReverseTrue = 0;
            msgStartReverseTrue = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
            string channel = "my/channel";
            startTimeWithReverseTrue = Pubnub.translateDateTimeToPubnubUnixNanoSeconds(DateTime.UtcNow);
            for (int index = 0; index < 10; index++)
            {
                pubnub.publish<string>(channel,
                    string.Format("DetailedHistoryStartTimeWithReverseTrue {0} {1}", startTimeWithReverseTrue, index),
                    DetailedHistorySamplePublishCallback);
                mrePublishStartReverseTrue.WaitOne(5000);
            }

            Thread.Sleep(5000);

            pubnub.detailedHistory<string>(channel, startTimeWithReverseTrue, DetailedHistoryStartWithReverseTrueCallback, true);
            mreMsgStartReverseTrue.WaitOne(310 * 1000);
            Assert.IsTrue(msgStartReverseTrue, "Detailed History with Start and Reverse True Failed");
        }
开发者ID:netcon-source,项目名称:pubnub-api,代码行数:21,代码来源:WhenDetailedHistoryIsRequested.cs

示例8: DetailedHistoryStartWithReverseTrue

        public void DetailedHistoryStartWithReverseTrue()
        {
            expectedCountAtStartTimeWithReverseTrue = 0;
            msgStartReverseTrue = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
            string channel = "my/channel";
            startTimeWithReverseTrue = Pubnub.translateDateTimeToPubnubUnixNanoSeconds(DateTime.UtcNow);

            EnqueueCallback(() =>
            {
                for (int index = 0; index < 10; index++)
                {
                    EnqueueCallback(() =>
                    {
                        pubnub.publish<string>(channel, string.Format("DetailedHistoryStartTimeWithReverseTrue {0} {1}", startTimeWithReverseTrue, index), DetailedHistorySamplePublishCallback);
                    });
                    EnqueueConditional(() => isPublishStartReverseTrue);
                }
            });

            //EnqueueCallback(() => Thread.Sleep(5000)); !!!

            EnqueueCallback(() => pubnub.detailedHistory<string>(channel, startTimeWithReverseTrue, DetailedHistoryStartWithReverseTrueCallback, true));
            EnqueueConditional(() => isDetailedHistoryStartReverseTrue);
            EnqueueCallback(() => Assert.IsTrue(msgStartReverseTrue, "Detailed History with Start and Reverse True Failed"));

            EnqueueTestComplete();
        }
开发者ID:hellogurus,项目名称:pubnub-api,代码行数:28,代码来源:WhenDetailedHistoryIsRequested.cs

示例9: ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo

        public void ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo()
        {
            isSecretEncryptPublished = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "key", "enigma", false);

            PubnubUnitTest unitTest = new PubnubUnitTest();
            unitTest.TestClassName = "WhenAMessageIsPublished";
            unitTest.TestCaseName = "ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo";

            pubnub.PubnubUnitTest = unitTest;

            string channel = "my/channel";
            string message = messageForSecretEncryptPublish;

            pubnub.publish<string>(channel, message, ReturnSuccessSecretEncryptPublishCodeCallback);
            mreSecretEncryptPub.WaitOne(310 * 1000);

            if (!isSecretEncryptPublished)
            {
                Assert.IsTrue(isSecretEncryptPublished, "Secret Encrypt Publish Failed");
            }
            else
            {
                pubnub.detailedHistory<string>(channel, -1, secretEncryptPublishTimetoken, -1, false, CaptureSecretEncryptDetailedHistoryCallback);
                mreSecretEncryptDH.WaitOne(310 * 1000);
                Assert.IsTrue(isSecretEncryptDH, "Unable to decrypt the successful Secret key Publish");
            }
        }
开发者ID:sevco777,项目名称:pubnub-api,代码行数:28,代码来源:WhenAMessageIsPublished.cs

示例10: ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo

        public void ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo()
        {
            isEncryptObjectPublished = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false);
            
            PubnubUnitTest unitTest = new PubnubUnitTest();
            unitTest.TestClassName = "WhenAMessageIsPublished";
            unitTest.TestCaseName = "ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo";

            pubnub.PubnubUnitTest = unitTest;

            string channel = "my/channel";
            object message = new SecretCustomClass();
            messageObjectForEncryptPublish = JsonConvert.SerializeObject(message);

            pubnub.publish<string>(channel, message, ReturnSuccessEncryptObjectPublishCodeCallback);
            mreEncryptObjectPub.WaitOne(310 * 1000);

            if (!isEncryptObjectPublished)
            {
                Assert.IsTrue(isEncryptObjectPublished, "Encrypt Object Publish Failed");
            }
            else
            {
                pubnub.detailedHistory<string>(channel, -1, encryptObjectPublishTimetoken, -1, false, CaptureEncryptObjectDetailedHistoryCallback);
                mreEncryptObjectDH.WaitOne(310 * 1000);
                Assert.IsTrue(isEncryptObjectDH, "Unable to match the successful encrypt object Publish");
            }
        }
开发者ID:sevco777,项目名称:pubnub-api,代码行数:29,代码来源:WhenAMessageIsPublished.cs

示例11: ThenEncryptPublishShouldReturnSuccessCodeAndInfo

        public void ThenEncryptPublishShouldReturnSuccessCodeAndInfo()
        {
            isEncryptPublished = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false);
            string channel = "my/channel";
            string message = messageForEncryptPublish;

            pubnub.publish<string>(channel, message, ReturnSuccessEncryptPublishCodeCallback);
            mreEncryptPub.WaitOne(310 * 1000);

            if (!isEncryptPublished)
            {
                Assert.IsTrue(isEncryptPublished, "Encrypt Publish Failed");
            }
            else
            {
                pubnub.detailedHistory<string>(channel, -1, encryptPublishTimetoken, -1, false, CaptureEncryptDetailedHistoryCallback);
                mreEncryptDH.WaitOne(310 * 1000);
                Assert.IsTrue(isEncryptDH, "Unable to decrypt the successful Publish");
            }
        }
开发者ID:netcon-source,项目名称:pubnub-api,代码行数:21,代码来源:WhenAMessageIsPublished.cs

示例12: ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo

        public void ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo()
        {
            isUnencryptObjectPublished = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
            string channel = "my/channel";
            object message = new CustomClass();
            messageObjectForUnencryptPublish = JsonConvert.SerializeObject(message);

            pubnub.publish<string>(channel, message, ReturnSuccessUnencryptObjectPublishCodeCallback);
            mreUnencryptObjectPub.WaitOne(310 * 1000);

            if (!isUnencryptObjectPublished)
            {
                Assert.IsTrue(isUnencryptObjectPublished, "Unencrypt Publish Failed");
            }
            else
            {
                pubnub.detailedHistory<string>(channel, -1, unEncryptObjectPublishTimetoken, -1, false, CaptureUnencryptObjectDetailedHistoryCallback);
                mreUnencryptObjectDH.WaitOne(310 * 1000);
                Assert.IsTrue(isUnencryptObjectDH, "Unable to match the successful unencrypt object Publish");
            }
        }
开发者ID:netcon-source,项目名称:pubnub-api,代码行数:22,代码来源:WhenAMessageIsPublished.cs

示例13: DetailedHistoryStartWithReverseTrue

        public void DetailedHistoryStartWithReverseTrue()
        {
            expectedCountAtStartTimeWithReverseTrue = 0;
            msgStartReverseTrue = false;
            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);

            PubnubUnitTest unitTest = new PubnubUnitTest();
            unitTest.TestClassName = "WhenDetailedHistoryIsRequested";
            unitTest.TestCaseName = "DetailedHistoryStartWithReverseTrue";

            pubnub.PubnubUnitTest = unitTest;


            string channel = "my/channel";
            startTimeWithReverseTrue = Pubnub.translateDateTimeToPubnubUnixNanoSeconds(new DateTime(2012,12,1));
            for (int index = 0; index < 10; index++)
            {
                pubnub.publish<string>(channel, 
                    string.Format("DetailedHistoryStartTimeWithReverseTrue {0}", index), 
                    DetailedHistorySamplePublishCallback);
                mrePublishStartReverseTrue.WaitOne();
            }

            Thread.Sleep(2000);

            pubnub.detailedHistory<string>(channel, startTimeWithReverseTrue, DetailedHistoryStartWithReverseTrueCallback, true);
            mreMsgStartReverseTrue.WaitOne(310 * 1000);
            Assert.IsTrue(msgStartReverseTrue, "Detailed History with Start and Reverse True Failed");
        }
开发者ID:sevco777,项目名称:pubnub-api,代码行数:29,代码来源:WhenDetailedHistoryIsRequested.cs


注:本文中的Pubnub.detailedHistory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。