public void TestYayDecryptionBasic() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "q/xJqqN6qbiZMXYmiQC1Fw=="; //decrypt string dec = pc.decrypt(strMessage); //deserialize again Assert.AreEqual("yay!", dec); }
public void TestHashDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = "GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g="; //decrypt string dec = pc.decrypt(strMessage); Assert.AreEqual("{\"foo\":{\"bar\":\"foobar\"}}", dec); }
public void TestNullDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = null; //decrypt string dec = pc.decrypt(strMessage); Assert.AreEqual("", dec); }
public void TestStuffcanDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = "zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF"; //decrypt string dec = pc.decrypt(strMessage); Assert.AreEqual("{\"this stuff\":{\"can get\":\"complicated!\"}}", dec); }
public void TestPubNubDecryption1() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0="; //JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = JsonConvert.DeserializeObject <string>(dec); Assert.True(("Pubnub Messaging API 1").Equals(strMessage)); }
public void TestPubNubDecryption2() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54="; //Decrypt string dec = pc.decrypt(strMessage); //Deserialize //JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = JsonConvert.DeserializeObject <string>(dec); Assert.True(("Pubnub Messaging API 2").Equals(strMessage)); }
public void TestPubNubDecryption2() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54="; //Decrypt string dec = pc.decrypt(strMessage); //Deserialize JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = js.Deserialize <string>(dec); Assert.AreEqual("Pubnub Messaging API 2", strMessage); }
public void TestPubNubDecryption1() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize <string>(dec); Assert.AreEqual("Pubnub Messaging API 1", strMessage); }
public void TestUnicodeCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "+BY5/miAA8aeuhVl4d13Kg=="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize <string>(dec); Assert.AreEqual("漢語", strMessage); }
public void TestGermanCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "stpgsG1DZZxb44J7mFNSzg=="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize <string>(dec); Assert.AreEqual("ÜÖ", strMessage); }
public void TestGermanCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "stpgsG1DZZxb44J7mFNSzg=="; //JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = JsonConvert.DeserializeObject <string>(dec); Assert.True(("ÜÖ").Equals(strMessage)); }
public void TestUnicodeCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "+BY5/miAA8aeuhVl4d13Kg=="; //JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = JsonConvert.DeserializeObject <string>(dec); Assert.True(("漢語").Equals(strMessage)); }
public void TestObjectDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string strMessage = "IDjZE9BHSjcX67RddfCYYg=="; //Decrypt string dec = pc.decrypt(strMessage); //create an object Object obj = new Object(); //Serialize the object //JavaScriptSerializer js = new JavaScriptSerializer(); string res = JsonConvert.SerializeObject(obj); Assert.True(dec.Equals(res)); }
public void TestObjectDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string strMessage = "IDjZE9BHSjcX67RddfCYYg=="; //Decrypt string dec = pc.decrypt(strMessage); //create an object Object obj = new Object(); //Serialize the object JavaScriptSerializer js = new JavaScriptSerializer(); string res = js.Serialize(obj); Assert.AreEqual(dec, res); }
public void TestMyObjectDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string strMessage = "Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE="; //Decrypt string dec = pc.decrypt(strMessage); //create an object of the custom class CustomClass cc = new CustomClass(); JavaScriptSerializer js = new JavaScriptSerializer(); //Serialize it string res = js.Serialize(cc); Assert.AreEqual(dec, res); }
public void TestArrayDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Input the deserialized string string strMessage = "Ns4TB41JjT2NCXaGLWSPAQ=="; //decrypt string dec = pc.decrypt(strMessage); //create a serialized object object [] objArr = {}; JavaScriptSerializer js = new JavaScriptSerializer(); string res = js.Serialize(objArr); //compare the serialized object and the return of the Decrypt method Assert.AreEqual(res, dec); }
public void TestYayDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //string strMessage= "\"q/xJqqN6qbiZMXYmiQC1Fw==\""; //Non deserialized string string strMessage = "\"Wi24KS4pcTzvyuGOHubiXg==\""; //Deserialize //JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = JsonConvert.DeserializeObject <string>(strMessage); //decrypt string dec = pc.decrypt(strMessage); //deserialize again strMessage = JsonConvert.DeserializeObject <string>(dec); Assert.True(("yay!").Equals(strMessage)); }
public void TestYayDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //string strMessage= "\"q/xJqqN6qbiZMXYmiQC1Fw==\""; //Non deserialized string string strMessage = "\"Wi24KS4pcTzvyuGOHubiXg==\""; //Deserialize JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = js.Deserialize <string>(strMessage); //decrypt string dec = pc.decrypt(strMessage); //deserialize again strMessage = js.Deserialize <string>(dec); Assert.AreEqual("yay!", strMessage); }
public void TestYayDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //string strMessage= "\"q/xJqqN6qbiZMXYmiQC1Fw==\""; //Non deserialized string string strMessage = "\"Wi24KS4pcTzvyuGOHubiXg==\""; //Deserialize JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = js.Deserialize<string>(strMessage); //decrypt string dec = pc.decrypt(strMessage); //deserialize again strMessage = js.Deserialize<string>(dec); Assert.AreEqual("yay!", strMessage); }
public void TestMyObjectDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string strMessage = "Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE="; //Decrypt string dec = pc.decrypt(strMessage); //create an object of the custom class CustomClass cc = new CustomClass(); JavaScriptSerializer js = new JavaScriptSerializer(); //Serialize it string res = js.Serialize(cc); Assert.AreEqual(res, dec); }
public void TestObjectDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string strMessage = "IDjZE9BHSjcX67RddfCYYg=="; //Decrypt string dec = pc.decrypt(strMessage); //create an object Object obj = new Object(); //Serialize the object JavaScriptSerializer js = new JavaScriptSerializer(); string res = js.Serialize(obj); Assert.AreEqual(res, dec); }
public void TestPubNubDecryption1() { PubnubCrypto pc = new PubnubCrypto("enigma"); //deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize<string>(dec); Assert.AreEqual("Pubnub Messaging API 1", strMessage); }
public void TestPubNubDecryption2() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Deserialized string string strMessage = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54="; //Decrypt string dec = pc.decrypt(strMessage); //Deserialize JavaScriptSerializer js = new JavaScriptSerializer(); strMessage = js.Deserialize<string>(dec); Assert.AreEqual("Pubnub Messaging API 2", strMessage); }
public void TestUnicodeCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "+BY5/miAA8aeuhVl4d13Kg=="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize<string>(dec); Assert.AreEqual("漢語", strMessage); }
public void TestGermanCharsDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); string strMessage = "stpgsG1DZZxb44J7mFNSzg=="; JavaScriptSerializer js = new JavaScriptSerializer(); //decrypt string dec = pc.decrypt(strMessage); //deserialize strMessage = js.Deserialize<string>(dec); Assert.AreEqual("ÜÖ", strMessage); }
public void TestArrayDecryption() { PubnubCrypto pc = new PubnubCrypto("enigma"); //Input the deserialized string string strMessage = "Ns4TB41JjT2NCXaGLWSPAQ=="; //decrypt string dec = pc.decrypt(strMessage); //create a serialized object object[] objArr = { }; JavaScriptSerializer js = new JavaScriptSerializer(); string res = js.Serialize(objArr); //compare the serialized object and the return of the Decrypt method Assert.AreEqual(res, dec); }