예제 #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");
        }
예제 #2
0
        public void IPostBackDataHandler_LoadPostData_NullCollection()
        {
            TestHtmlTextArea     ta   = new TestHtmlTextArea();
            IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);

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

            ta.ServerChange += new EventHandler(ServerChange);
            serverChange     = false;
            ta.Raise();
            Assert.IsTrue(serverChange, "ServerClick");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
		}
예제 #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");
        }
예제 #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");
        }
예제 #14
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());
        }
예제 #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");
        }
예제 #16
0
		public void AddParsedSubObject_DataBoundLiteralControl ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (new DataBoundLiteralControl (1,1));
		}
예제 #17
0
        public void AddParsedSubObject_DataBoundLiteralControl()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

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

            ta.PublicAddParsedSubObject(new LiteralControl());
        }
예제 #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");
		}
예제 #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");
		}
예제 #21
0
        public void LoadPostData_NullCollection()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.LoadPost("id1", null);
        }
예제 #22
0
		[NUnit.Framework.Category ("NotWorking")] // Mono throw HttpException
		public void AddParsedSubObject_Null ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (null);
		}
예제 #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");
		}
예제 #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");
		}
예제 #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");
		}
예제 #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");
		}
예제 #27
0
		public void RaisePostBackEvent ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.ServerChange += new EventHandler (ServerChange);
			serverChange = false;
			ta.Raise ();
			Assert.IsTrue (serverChange, "ServerClick");
		}
예제 #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");
		}
예제 #29
0
		public void AddParsedSubObject_LiteralControl ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (new LiteralControl ());
		}
예제 #30
0
		public void IPostBackDataHandler_LoadPostData_NullCollection ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			IPostBackDataHandler pbdh = (ta as IPostBackDataHandler);
			pbdh.LoadPostData ("id1", null);
		}
예제 #31
0
		public void AddParsedSubObject_WrongType ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.PublicAddParsedSubObject (this);
		}
예제 #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");
		}
예제 #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");
		}
예제 #34
0
        [NUnit.Framework.Category("NotWorking")]          // Mono throw HttpException
        public void AddParsedSubObject_Null()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(null);
        }
예제 #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 ());
		}
예제 #36
0
        public void AddParsedSubObject_WrongType()
        {
            TestHtmlTextArea ta = new TestHtmlTextArea();

            ta.PublicAddParsedSubObject(this);
        }
예제 #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");
		}
예제 #38
0
		public void LoadPostData_NullCollection ()
		{
			TestHtmlTextArea ta = new TestHtmlTextArea ();
			ta.LoadPost ("id1", null);
		}