public void NoEqualSign() { NameValuePairCollection nameValuePairs = new NameValuePairCollection("a"); NameValuePair pair = nameValuePairs[0]; Assert.AreEqual(1, nameValuePairs.Count); Assert.AreEqual(String.Empty, nameValuePairs.GetValue("a")); Assert.AreEqual("a=", pair.ToString()); }
public void String() { var nvp = new NameValuePair <string>("test"); nvp.Value.Add("one"); nvp.Value.Add("two"); Assert.AreEqual("[test: one, two]", nvp.ToString()); }
public void TwoNameValuePairs() { NameValuePairCollection nameValuePairs = new NameValuePairCollection("a=1;b=2"); NameValuePair pair1 = nameValuePairs[0]; NameValuePair pair2 = nameValuePairs[1]; Assert.AreEqual(2, nameValuePairs.Count); Assert.AreEqual("1", nameValuePairs.GetValue("a")); Assert.AreEqual("a", pair1.Name); Assert.AreEqual("1", pair1.Value); Assert.AreEqual("a=1", pair1.ToString()); Assert.AreEqual("2", nameValuePairs.GetValue("b")); Assert.AreEqual("b", pair2.Name); Assert.AreEqual("2", pair2.Value); Assert.AreEqual("b=2", pair2.ToString()); Assert.AreEqual("a=1;b=2", nameValuePairs.GetList()); }
public void String() { var nvp = new NameValuePair<string>("test"); nvp.Value.Add("one"); nvp.Value.Add("two"); Assert.AreEqual("[test: one, two]", nvp.ToString()); }