public void will_return_value_from_missing_element() { XElement el = XElement.Parse("<fooBar foo=\"bar\" />"); string str = XMLUtilities.test_element(el, "snafu"); Assert.IsNotNull(str); }
public void will_not_blow_up_on_missing_element() { var el = new XElement("test", "foo"); string bar = XMLUtilities.test_element(el, "bar"); Assert.That(bar == ""); }
public void can_set_and_get_element() { var el = new XElement("test", "foo"); XMLUtilities.set_element(el, "bar", "&&"); string bar = XMLUtilities.test_element(el, "bar"); Assert.That(bar == "&&"); }
protected string test_element(string element_name) { /* * if (this[element_name] == null) return ""; * if (this[element_name].FirstChild == null) return ""; * if (this[element_name].FirstChild.GetType() != Type.GetType("TextNode")) return ""; * return this[element_name].InnerText; * */ return(XMLUtilities.test_element(this, element_name)); }
protected string test_element(string element_name) { return(XMLUtilities.test_element(this, element_name)); }