Exemplo n.º 1
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());
        }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
        public void SingleNameValuePairWithSpaces()
        {
            NameValuePairCollection nameValuePairs = new NameValuePairCollection(" a = b ");
            NameValuePair           pair           = nameValuePairs[0];

            Assert.AreEqual(1, nameValuePairs.Count);
            Assert.AreEqual("b", nameValuePairs.GetValue("a"));
            Assert.AreEqual("a", pair.Name);
            Assert.AreEqual("b", pair.Value);
        }
 string IWixPropertyValueProvider.GetValue(string name)
 {
     return(tags.GetValue(name));
 }