Example #1
0
        [Test] public void Xml_DefaultTrasnform()
        {
            XmlPoker xml = new XmlPoker();

            // For the actual transform, I was lazy, but
            // xsp's web_xml.aspx works.
        }
Example #2
0
        [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");
        }
Example #3
0
		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");
		}
Example #4
0
        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");
        }
Example #5
0
        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");
        }
Example #6
0
        [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");
        }
Example #7
0
        [Test] public void Xml_InsertValid()
        {
            XmlPoker xml = new XmlPoker();

            xml.DoAdd(new LiteralControl("<test></test>"));
        }
Example #8
0
        [Test] public void Xml_InsertInvalid2()
        {
            XmlPoker xml = new XmlPoker();

            xml.DoAdd(null);
        }
Example #9
0
        [Test] public void Xml_InsertInvalid()
        {
            XmlPoker xml = new XmlPoker();

            xml.DoAdd("hello");
        }
Example #10
0
		[Test] public void Xml_InsertInvalid2 ()
		{
			XmlPoker xml = new XmlPoker ();

			xml.DoAdd (null);
		}
Example #11
0
		[Test] public void Xml_InsertValid ()
		{
			XmlPoker xml = new XmlPoker ();

			xml.DoAdd (new LiteralControl ("<test></test>"));
		}
Example #12
0
		[Test] public void Xml_InsertInvalid ()
		{
			XmlPoker xml = new XmlPoker ();

			xml.DoAdd ("hello");
		}
Example #13
0
		[Test] public void Xml_DefaultTrasnform ()
		{
			XmlPoker xml = new XmlPoker ();

			// For the actual transform, I was lazy, but
			// xsp's web_xml.aspx works.
		}
Example #14
0
		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");

		}
Example #15
0
		[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");
		}
Example #16
0
		[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");
		}