示例#1
0
        public void TestGermanCharsDecryptionJSONFx()
        {
            PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
            string       message      = "stpgsG1DZZxb44J7mFNSzg==";
            //decrypt
            string decrypted = pubnubCrypto.Decrypt(message);

            //deserialize
            message = Common.DeserializeUsingJSONFx <string>(decrypted);

            Assert.AreEqual("ÜÖ", message);
        }
示例#2
0
        public void TestPubNubDecryption1JSONFx()
        {
            PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
            //deserialized string
            string message = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=";
            //decrypt
            string decrypted = pubnubCrypto.Decrypt(message);

            //deserialize
            message = Common.DeserializeUsingJSONFx <string>(decrypted);
            Assert.AreEqual("Pubnub Messaging API 1", message);
        }
示例#3
0
        public void TestUnicodeCharsDecryptionJSONFx()
        {
            PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
            string       message      = "+BY5/miAA8aeuhVl4d13Kg==";
            //decrypt
            string decrypted = pubnubCrypto.Decrypt(message);

            //deserialize
            message = Common.DeserializeUsingJSONFx <string>(decrypted);

            Assert.AreEqual("漢語", message);
        }
示例#4
0
        public void TestPubNubDecryption2JSONFx()
        {
            PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
            //Deserialized string
            string message = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=";
            //Decrypt
            string decrypted = pubnubCrypto.Decrypt(message);

            //Deserialize
            message = Common.DeserializeUsingJSONFx <string>(decrypted);
            Assert.AreEqual("Pubnub Messaging API 2", message);
        }
示例#5
0
        public void TestYayDecryptionJSONFx()
        {
            PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
            //Non deserialized string
            string message = "\"Wi24KS4pcTzvyuGOHubiXg==\"";

            //Deserialize
            message = Common.DeserializeUsingJSONFx <string>(message);

            //decrypt
            string decrypted = pubnubCrypto.Decrypt(message);

            //deserialize again
            message = Common.DeserializeUsingJSONFx <string>(decrypted);
            Assert.AreEqual("yay!", message);
        }