public void ConvertFrom()
 {
     string xml =
         "<foo>" +
         "	<add key=\"one\" value=\"1\"/>" +
         "	<add key=\"two\" value=\"2\"/>" +
         "</foo>";
     NameValueConverter vrt = new NameValueConverter ();
     NameValueCollection actual = vrt.ConvertFrom (xml) as NameValueCollection;
     Assert.IsNotNull (actual);
     Assert.AreEqual (2, actual.Count);
     Assert.AreEqual ("one", actual.GetKey (0));
     Assert.AreEqual ("two", actual.GetKey (1));
     Assert.AreEqual ("1", actual ["one"]);
     Assert.AreEqual ("2", actual ["two"]);
 }
Exemplo n.º 2
0
        public void ConvertFrom()
        {
            string xml =
                "<foo>" +
                "	<add key=\"one\" value=\"1\"/>"+
                "	<add key=\"two\" value=\"2\"/>"+
                "</foo>";
            NameValueConverter  vrt    = new NameValueConverter();
            NameValueCollection actual = vrt.ConvertFrom(xml) as NameValueCollection;

            Assert.IsNotNull(actual);
            Assert.AreEqual(2, actual.Count);
            Assert.AreEqual("one", actual.GetKey(0));
            Assert.AreEqual("two", actual.GetKey(1));
            Assert.AreEqual("1", actual ["one"]);
            Assert.AreEqual("2", actual ["two"]);
        }
 public void ConvertFromNullReference()
 {
     NameValueConverter vrt = new NameValueConverter ();
     vrt.ConvertFrom (null);
 }
 public void ConvertFromNonSupportedOptionBails()
 {
     NameValueConverter vrt = new NameValueConverter ();
     vrt.ConvertFrom (true);
 }
Exemplo n.º 5
0
        public void ConvertFromNonSupportedOptionBails()
        {
            NameValueConverter vrt = new NameValueConverter();

            vrt.ConvertFrom(true);
        }
Exemplo n.º 6
0
        public void ConvertFromNullReference()
        {
            NameValueConverter vrt = new NameValueConverter();

            vrt.ConvertFrom(null);
        }