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 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); }
public void ConvertFromNonSupportedOptionBails() { NameValueConverter vrt = new NameValueConverter(); vrt.ConvertFrom(true); }
public void ConvertFromNullReference() { NameValueConverter vrt = new NameValueConverter(); vrt.ConvertFrom(null); }