Beispiel #1
0
        public void CleanProperties()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.Cols = 1;
            Assert.AreEqual(1, ta.Cols, "Cols");
            ta.Name = "name";
            Assert.IsNull(ta.Name, "Name");
            ta.Rows = 2;
            Assert.AreEqual(2, ta.Rows, "Rows");
            ta.Value = "value";
            Assert.AreEqual("value", ta.Value, "Value");
            Assert.AreEqual(3, ta.Attributes.Count, "3");
            Assert.AreEqual(3, ta.StateBag.Count, "StateBag.Count=3");

            ta.Cols = -1;
            Assert.AreEqual(-1, ta.Cols, "-Cols");
            ta.Name = null;
            Assert.IsNull(ta.Name, "-Name");
            ta.Rows = -1;
            Assert.AreEqual(-1, ta.Rows, "Rows");
            ta.Value = null;
            Assert.AreEqual(String.Empty, ta.Value, "-Value");
            Assert.AreEqual(0, ta.Attributes.Count, "0");
            Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count=0");
        }
Beispiel #2
0
        public void IPostBackDataHandler_LoadPostData_NullCollection()
        {
            TestHtmlTextArea     ta   = new TestHtmlTextArea();
            IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);

            pbdh.LoadPostData("id1", null);
        }
Beispiel #3
0
        public void RaisePostBackEvent()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ServerChange += new EventHandler(ServerChange);
            serverChange     = false;
            ta.Raise();
            Assert.IsTrue(serverChange, "ServerClick");
        }
Beispiel #4
0
        public void IPostBackDataHandler_RaisePostBackEvent()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ServerChange += new EventHandler(ServerChange);
            IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);

            serverChange = false;
            pbdh.RaisePostDataChangedEvent();
            Assert.IsTrue(serverChange, "ServerChange");
        }
Beispiel #5
0
        [Category("NotDotNet")]          // MS throws a NullReferenceException here
        public void LoadPostData_WrongId()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ID = "id1";
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("id1", "mono");
            Assert.IsFalse(ta.LoadPost("id2", nvc), "LoadPostData");
            Assert.AreEqual(String.Empty, ta.Value, "Value");
        }
Beispiel #6
0
        public void LoadPostData()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ID = "id1";
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("id1", "mono");
            Assert.IsTrue(ta.LoadPost("id1", nvc), "LoadPostData");
            Assert.AreEqual("mono", ta.Value, "Value");
        }
Beispiel #7
0
        [Category("NotDotNet")]          // MS throws a NullReferenceException here
        public void IPostBackDataHandler_LoadPostData_IdNull()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ID = "id1";
            IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
            NameValueCollection  nvc  = new NameValueCollection();

            nvc.Add("id1", "mono");
            Assert.IsFalse(pbdh.LoadPostData(null, new NameValueCollection()));
            Assert.AreEqual(String.Empty, ta.Value, "Value");
        }
Beispiel #8
0
        public void IPostBackDataHandler_LoadPostData()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.ID = "id1";
            IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
            NameValueCollection  nvc  = new NameValueCollection();

            nvc.Add("id1", "mono");
            Assert.IsTrue(pbdh.LoadPostData("id1", nvc), "LoadPostData");
            Assert.AreEqual("mono", ta.Value, "Value");
        }
Beispiel #9
0
        public void RenderAttributes()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.Cols  = 4;
            ta.Rows  = 2;
            ta.Name  = "mono";
            ta.Value = "value";
            // value is out
            HtmlDiff.AssertAreEqual("<dummy name cols=\"4\" rows=\"2\" />", ta.RenderAttributes(), "RenderAttributes failed #1");

            ta.ID = "go";
            HtmlDiff.AssertAreEqual("<dummy name=\"go\" id=\"go\" cols=\"4\" rows=\"2\" />", ta.RenderAttributes(), "RenderAttributes failed #2");
        }
Beispiel #10
0
        public void Render()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.Cols  = 4;
            ta.Rows  = 2;
            ta.Name  = "mono";
            ta.Value = "value";
            // value is out
            HtmlDiff.AssertAreEqual("<textarea name cols=\"4\" rows=\"2\">value</textarea>", ta.Render(), "Render #1");

            ta.ID = "go";
            HtmlDiff.AssertAreEqual("<textarea name=\"go\" id=\"go\" cols=\"4\" rows=\"2\">value</textarea>", ta.Render(), "Render #2");
        }
Beispiel #11
0
		public void DefaultProperties ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count");
			Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count");

			Assert.AreEqual (-1, ta.Cols, "Cols");
			Assert.IsNull (ta.Name, "Name");
			Assert.AreEqual (-1, ta.Rows, "Rows");
			Assert.AreEqual (String.Empty, ta.Value, "Value");

			Assert.AreEqual ("textarea", ta.TagName, "TagName");
			Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count-2");
			Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count-2");
		}
Beispiel #12
0
        public void NullProperties()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.Cols = -1;
            Assert.AreEqual(-1, ta.Cols, "Cols");
            ta.Name = null;
            Assert.IsNull(ta.Name, "Name");
            ta.Rows = -1;
            Assert.AreEqual(-1, ta.Rows, "Rows");
            ta.Value = null;
            Assert.AreEqual(String.Empty, ta.Value, "Value");

            Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count");
            Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count");
        }
Beispiel #13
0
        public void DefaultProperties()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count");
            Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count");

            Assert.AreEqual(-1, ta.Cols, "Cols");
            Assert.IsNull(ta.Name, "Name");
            Assert.AreEqual(-1, ta.Rows, "Rows");
            Assert.AreEqual(String.Empty, ta.Value, "Value");

            Assert.AreEqual("textarea", ta.TagName, "TagName");
            Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count-2");
            Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count-2");
        }
        [Category("NotDotNet")]          // Implementation details changes : Control name will diffrent.
        public void RenderName1()
        {
            UserControl ctrl = new UserControl();

            ctrl.ID = "UC";
            Page page = new Page();

            page.EnableEventValidation = false;
            TestHtmlTextArea ta = new TestHtmlTextArea();

            page.Controls.Add(ctrl);
            ctrl.Controls.Add(ta);
            ta.Name = "mono";
            ta.ID   = "go";
            string expected = "<dummy name=\"UC$go\" id=\"UC_go\" />";

            Assert.AreEqual(expected, ta.RenderAttributes());
        }
Beispiel #15
0
        public void Value()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            Assert.AreEqual(0, ta.Attributes.Count, "0");
            Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count=0");

            ta.Value = "value";
            Assert.AreEqual("value", ta.Value, "Value");
            Assert.AreEqual(1, ta.Attributes.Count, "1");
            Assert.AreEqual(1, ta.StateBag.Count, "StateBag.Count=1");

            // however it's not in attributes
            Assert.IsNull(ta.Attributes["value"], "Attributes");
            // but in InnerText and InnerHtml
            Assert.AreEqual("value", ta.InnerText, "InnerText");
            Assert.AreEqual("value", ta.InnerHtml, "InnerHtml");
            // the later is kept in the attributes
            Assert.IsNull(ta.Attributes["innertext"], "Attributes-InnerText");
            Assert.AreEqual("value", ta.Attributes["innerhtml"], "Attributes-InnerHtml");
        }
Beispiel #16
0
		public void AddParsedSubObject_DataBoundLiteralControl ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (new DataBoundLiteralControl (1,1));
		}
Beispiel #17
0
        public void AddParsedSubObject_DataBoundLiteralControl()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(new DataBoundLiteralControl(1, 1));
        }
Beispiel #18
0
        public void AddParsedSubObject_LiteralControl()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(new LiteralControl());
        }
Beispiel #19
0
		[Category ("NotDotNet")] // MS throws a NullReferenceException here
		public void LoadPostData_WrongId ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ID = "id1";
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsFalse (ta.LoadPost ("id2", nvc), "LoadPostData");
			Assert.AreEqual (String.Empty, ta.Value, "Value");
		}
Beispiel #20
0
		public void RenderAttributes ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.Cols = 4;
			ta.Rows = 2;
			ta.Name = "mono";
			ta.Value = "value";
			// value is out
			HtmlDiff.AssertAreEqual ("<dummy name cols=\"4\" rows=\"2\" />", ta.RenderAttributes (), "RenderAttributes failed #1");

			ta.ID = "go";
			HtmlDiff.AssertAreEqual ("<dummy name=\"go\" id=\"go\" cols=\"4\" rows=\"2\" />", ta.RenderAttributes (), "RenderAttributes failed #2");
		}
Beispiel #21
0
        public void LoadPostData_NullCollection()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.LoadPost("id1", null);
        }
Beispiel #22
0
		[NUnit.Framework.Category ("NotWorking")] // Mono throw HttpException
		public void AddParsedSubObject_Null ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (null);
		}
Beispiel #23
0
		[Category ("NotDotNet")] // MS throws a NullReferenceException here
		public void IPostBackDataHandler_LoadPostData_IdNull ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ID = "id1";
			IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsFalse (pbdh.LoadPostData (null, new NameValueCollection ()));
			Assert.AreEqual (String.Empty, ta.Value, "Value");
		}
Beispiel #24
0
		public void Value ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			Assert.AreEqual (0, ta.Attributes.Count, "0");
			Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count=0");

			ta.Value = "value";
			Assert.AreEqual ("value", ta.Value, "Value");
			Assert.AreEqual (1, ta.Attributes.Count, "1");
			Assert.AreEqual (1, ta.StateBag.Count, "StateBag.Count=1");

			// however it's not in attributes
			Assert.IsNull (ta.Attributes["value"], "Attributes");
			// but in InnerText and InnerHtml
			Assert.AreEqual ("value", ta.InnerText, "InnerText");
			Assert.AreEqual ("value", ta.InnerHtml, "InnerHtml");
			// the later is kept in the attributes
			Assert.IsNull (ta.Attributes["innertext"], "Attributes-InnerText");
			Assert.AreEqual ("value", ta.Attributes["innerhtml"], "Attributes-InnerHtml");
		}
Beispiel #25
0
		public void IPostBackDataHandler_LoadPostData ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ID = "id1";
			IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsTrue (pbdh.LoadPostData ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("mono", ta.Value, "Value");
		}
Beispiel #26
0
		public void NullProperties ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.Cols = -1;
			Assert.AreEqual (-1, ta.Cols, "Cols");
			ta.Name = null;
			Assert.IsNull (ta.Name, "Name");
			ta.Rows = -1;
			Assert.AreEqual (-1, ta.Rows, "Rows");
			ta.Value = null;
			Assert.AreEqual (String.Empty, ta.Value, "Value");

			Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count");
			Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count");
		}
Beispiel #27
0
		public void RaisePostBackEvent ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ServerChange += new EventHandler (ServerChange);
			serverChange = false;
			ta.Raise ();
			Assert.IsTrue (serverChange, "ServerClick");
		}
Beispiel #28
0
		public void LoadPostData ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ID = "id1";
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsTrue (ta.LoadPost ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("mono", ta.Value, "Value");
		}
Beispiel #29
0
		public void AddParsedSubObject_LiteralControl ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (new LiteralControl ());
		}
Beispiel #30
0
		public void IPostBackDataHandler_LoadPostData_NullCollection ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
			pbdh.LoadPostData ("id1", null);
		}
Beispiel #31
0
		public void AddParsedSubObject_WrongType ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (this);
		}
Beispiel #32
0
		public void IPostBackDataHandler_RaisePostBackEvent ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ServerChange += new EventHandler (ServerChange);
			IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
			serverChange = false;
			pbdh.RaisePostDataChangedEvent ();
			Assert.IsTrue (serverChange, "ServerChange");
		}
Beispiel #33
0
		public void Render ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.Cols = 4;
			ta.Rows = 2;
			ta.Name = "mono";
			ta.Value = "value";
			// value is out
			HtmlDiff.AssertAreEqual ("<textarea name cols=\"4\" rows=\"2\">value</textarea>", ta.Render (),"Render #1");

			ta.ID = "go";
			HtmlDiff.AssertAreEqual ("<textarea name=\"go\" id=\"go\" cols=\"4\" rows=\"2\">value</textarea>", ta.Render (),"Render #2");
		}
Beispiel #34
0
        [NUnit.Framework.Category("NotWorking")]          // Mono throw HttpException
        public void AddParsedSubObject_Null()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(null);
        }
Beispiel #35
0
		[Category ("NotDotNet")] // Implementation details changes : Control name will diffrent.
		public void RenderName1 ()
		{
			UserControl ctrl = new UserControl ();
			ctrl.ID = "UC";
			Page page = new Page ();
			page.EnableEventValidation = false;
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			page.Controls.Add (ctrl);
			ctrl.Controls.Add (ta);
			ta.Name = "mono";
			ta.ID = "go";
			string expected = "<dummy name=\"UC$go\" id=\"UC_go\" />";
			Assert.AreEqual (expected, ta.RenderAttributes ());
		}
Beispiel #36
0
        public void AddParsedSubObject_WrongType()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(this);
        }
Beispiel #37
0
		public void CleanProperties ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.Cols = 1;
			Assert.AreEqual (1, ta.Cols, "Cols");
			ta.Name = "name";
			Assert.IsNull (ta.Name, "Name");
			ta.Rows = 2;
			Assert.AreEqual (2, ta.Rows, "Rows");
			ta.Value = "value";
			Assert.AreEqual ("value", ta.Value, "Value");
			Assert.AreEqual (3, ta.Attributes.Count, "3");
			Assert.AreEqual (3, ta.StateBag.Count, "StateBag.Count=3");

			ta.Cols = -1;
			Assert.AreEqual (-1, ta.Cols, "-Cols");
			ta.Name = null;
			Assert.IsNull (ta.Name, "-Name");
			ta.Rows = -1;
			Assert.AreEqual (-1, ta.Rows, "Rows");
			ta.Value = null;
			Assert.AreEqual (String.Empty, ta.Value, "-Value");
			Assert.AreEqual (0, ta.Attributes.Count, "0");
			Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count=0");
		}
Beispiel #38
0
		public void LoadPostData_NullCollection ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.LoadPost ("id1", null);
		}