public void TestXmlEntityBasicUnescaping() { Assert.AreEqual(string.Empty, InstanceXml.TestXmlUnescapeString(null)); Assert.AreEqual(string.Empty, InstanceXml.TestXmlUnescapeString(string.Empty)); Assert.AreEqual("the 123,4567,890 jumpy foxes lazed over the quick brown dog", InstanceXml.TestXmlUnescapeString("the 123,4567,890 jumpy foxes lazed over the quick brown dog")); Assert.AreEqual("&\"<'>", InstanceXml.TestXmlUnescapeString("&amp;"<'>")); Assert.AreEqual("<a href=\"http://garba/\">tom&jerry's</a>", InstanceXml.TestXmlUnescapeString("<a href="http://garba/">tom&jerry's</a>")); }
private static void ValidateRoundtripUnescapeEscape(string data) { string unescaped = InstanceXml.TestXmlUnescapeString(data); string escaped = InstanceXml.TestXmlEscapeString(unescaped); Assert.AreEqual(escaped, data); Trace.WriteLine("Success - Unescaped string was " + unescaped); }
public void TestXmlEntityUnescapingSpecialFormattedEntities() { // these all say the same thing Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); Assert.AreEqual("\u001B", InstanceXml.TestXmlUnescapeString("")); }