public void TestEncodeEmpty() { var obj = new Dictionary <string, string>(); var encoded = KvpParser.Encode(obj); Assert.AreEqual(string.Empty, encoded); }
public static string ProfileFor(string email) { var profile = new Dictionary <string, string> { { "email", email }, { "uid", "10" }, { "role", "user" } }; return(KvpParser.Encode(profile)); }
public void TestEncodeSingle() { var obj = new Dictionary <string, string> { { "key", "value" } }; var encoded = KvpParser.Encode(obj); Assert.AreEqual("key=value", encoded); }
public void TestEncodeRemoveInvalidChars() { var obj = new Dictionary <string, string> { { "key1=", "=val1" }, { "key2&", "val2&" } }; var encoded = KvpParser.Encode(obj); Assert.AreEqual("key1=val1&key2=val2", encoded); }
public void TestEncodeMultiple() { var obj = new Dictionary <string, string> { { "key1", "val1" }, { "key2", "val2" }, { "key3", "val3" } }; var encoded = KvpParser.Encode(obj); Assert.AreEqual("key1=val1&key2=val2&key3=val3", encoded); }
public void TestEncodeNull() { KvpParser.Encode(null); }