Пример #1
0
        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());
        }
Пример #2
0
        public void String()
        {
            var nvp = new NameValuePair <string>("test");

            nvp.Value.Add("one");
            nvp.Value.Add("two");

            Assert.AreEqual("[test: one, two]", nvp.ToString());
        }
Пример #3
0
        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());
        }
Пример #4
0
        public void String()
        {
            var nvp = new NameValuePair<string>("test");
            nvp.Value.Add("one");
            nvp.Value.Add("two");

            Assert.AreEqual("[test: one, two]", nvp.ToString());
        }