public void ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo() { isEncryptObjectPublished = false; Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false); string channel = "my/channel"; object message = new SecretCustomClass(); messageObjectForEncryptPublish = JsonConvert.SerializeObject(message); EnqueueCallback(() => pubnub.publish <string>(channel, message, ReturnSuccessEncryptObjectPublishCodeCallback)); EnqueueConditional(() => isEncryptObjectPubCheck); EnqueueCallback(() => { if (!isEncryptObjectPublished) { Assert.IsTrue(isEncryptObjectPublished, "Encrypt Object Publish Failed"); } else { EnqueueCallback(() => pubnub.detailedHistory <string>(channel, -1, encryptObjectPublishTimetoken, -1, false, CaptureEncryptObjectDetailedHistoryCallback)); EnqueueConditional(() => isEncryptObjectDHCheck); EnqueueCallback(() => Assert.IsTrue(isEncryptObjectDH, "Unable to match the successful encrypt object Publish")); } }); EnqueueTestComplete(); }
public void ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo() { isEncryptObjectPublished = false; Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false); string channel = "my/channel"; object message = new SecretCustomClass(); messageObjectForEncryptPublish = JsonConvert.SerializeObject(message); EnqueueCallback(() => pubnub.publish<string>(channel, message, ReturnSuccessEncryptObjectPublishCodeCallback)); EnqueueConditional(() => isEncryptObjectPubCheck); EnqueueCallback(() => { if (!isEncryptObjectPublished) { Assert.IsTrue(isEncryptObjectPublished, "Encrypt Object Publish Failed"); } else { EnqueueCallback(() => pubnub.detailedHistory<string>(channel, -1, encryptObjectPublishTimetoken, -1, false, CaptureEncryptObjectDetailedHistoryCallback)); EnqueueConditional(() => isEncryptObjectDHCheck); EnqueueCallback(() => Assert.IsTrue(isEncryptObjectDH, "Unable to match the successful encrypt object Publish")); } }); EnqueueTestComplete(); }