[Test] public void Xml_DefaultTrasnform() { XmlPoker xml = new XmlPoker(); // For the actual transform, I was lazy, but // xsp's web_xml.aspx works. }
[Test] public void Xml_RenderEmpty() { XmlPoker xml = new XmlPoker(); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); xml.DoRender(hw); Assert.AreEqual("", sw.ToString(), "RE1"); }
public void Label_ViewState () { XmlPoker p = new XmlPoker (); Assert.AreEqual (p.Text, "", "A1"); p.Text = "Hello"; Assert.AreEqual (p.Text, "Hello", "A2"); object state = p.SaveState (); Poker copy = new Poker (); copy.LoadState (state); Assert.AreEqual (copy.Text, "Hello", "A3"); }
public void Label_ViewState() { XmlPoker p = new XmlPoker(); Assert.AreEqual(p.Text, "", "A1"); p.Text = "Hello"; Assert.AreEqual(p.Text, "Hello", "A2"); object state = p.SaveState(); Poker copy = new Poker(); copy.LoadState(state); Assert.AreEqual(copy.Text, "Hello", "A3"); }
public void Xml_SourcePrecedence_2() { XmlPoker xml = new XmlPoker(); XmlDocument xml_doc = new XmlDocument(); xml_doc.LoadXml("<document></document>"); xml.Document = xml_doc; XmlDocument xml_navigator_doc = new XmlDocument(); xml_navigator_doc.LoadXml("<navigator></navigator>"); xml.XPathNavigator = xml_navigator_doc.CreateNavigator(); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); xml.DoRender(hw); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?><navigator></navigator>", sw.ToString(), "Xml_SourcePrecedence_2"); }
[Test] public void Xml_SourcePrecedence() { XmlPoker xml = new XmlPoker(); xml.DocumentContent = "<content></content>"; XmlDocument xml_doc = new XmlDocument(); xml_doc.LoadXml("<document></document>"); xml.Document = xml_doc; // // Can not check the precendece for the file backend // because it requires a complete setup to check for the // file access permission to it (Control.MapPathSecure) // // xml.DocumentSource = "test.xml"; // StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); xml.DoRender(hw); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?><document></document>", sw.ToString(), "SP1"); // Now compare the inline XML xml.DocumentContent = "<content></content>"; sw = new StringWriter(); hw = new HtmlTextWriter(sw); xml.DoRender(hw); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-16\"?><content></content>", sw.ToString(), "SP1"); }
[Test] public void Xml_InsertValid() { XmlPoker xml = new XmlPoker(); xml.DoAdd(new LiteralControl("<test></test>")); }
[Test] public void Xml_InsertInvalid2() { XmlPoker xml = new XmlPoker(); xml.DoAdd(null); }
[Test] public void Xml_InsertInvalid() { XmlPoker xml = new XmlPoker(); xml.DoAdd("hello"); }
[Test] public void Xml_InsertInvalid2 () { XmlPoker xml = new XmlPoker (); xml.DoAdd (null); }
[Test] public void Xml_InsertValid () { XmlPoker xml = new XmlPoker (); xml.DoAdd (new LiteralControl ("<test></test>")); }
[Test] public void Xml_InsertInvalid () { XmlPoker xml = new XmlPoker (); xml.DoAdd ("hello"); }
[Test] public void Xml_DefaultTrasnform () { XmlPoker xml = new XmlPoker (); // For the actual transform, I was lazy, but // xsp's web_xml.aspx works. }
public void Xml_SourcePrecedence_2 () { XmlPoker xml = new XmlPoker (); XmlDocument xml_doc = new XmlDocument (); xml_doc.LoadXml ("<document></document>"); xml.Document = xml_doc; XmlDocument xml_navigator_doc = new XmlDocument (); xml_navigator_doc.LoadXml ("<navigator></navigator>"); xml.XPathNavigator = xml_navigator_doc.CreateNavigator (); StringWriter sw = new StringWriter (); HtmlTextWriter hw = new HtmlTextWriter (sw); xml.DoRender (hw); Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?><navigator></navigator>", sw.ToString (), "Xml_SourcePrecedence_2"); }
[Test] public void Xml_SourcePrecedence () { XmlPoker xml = new XmlPoker (); xml.DocumentContent = "<content></content>"; XmlDocument xml_doc = new XmlDocument (); xml_doc.LoadXml ("<document></document>"); xml.Document = xml_doc; // // Can not check the precendece for the file backend // because it requires a complete setup to check for the // file access permission to it (Control.MapPathSecure) // // xml.DocumentSource = "test.xml"; // StringWriter sw = new StringWriter (); HtmlTextWriter hw = new HtmlTextWriter (sw); xml.DoRender (hw); Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?><document></document>", sw.ToString (), "SP1"); // Now compare the inline XML xml.DocumentContent = "<content></content>"; sw = new StringWriter (); hw = new HtmlTextWriter (sw); xml.DoRender (hw); Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?><content></content>", sw.ToString (), "SP1"); }
[Test] public void Xml_RenderEmpty () { XmlPoker xml = new XmlPoker (); StringWriter sw = new StringWriter (); HtmlTextWriter hw = new HtmlTextWriter (sw); xml.DoRender (hw); Assert.AreEqual ("", sw.ToString (), "RE1"); }