示例#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.
        }
示例#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");
        }
示例#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");
		}
示例#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");
        }
示例#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");
        }
示例#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");
        }
示例#7
0
        [Test] public void Xml_InsertValid()
        {
            XmlPoker xml = new XmlPoker();

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

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

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

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

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

			xml.DoAdd ("hello");
		}
示例#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.
		}
示例#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");

		}
示例#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");
		}
示例#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");
		}