Example #1
0
        public void IPostBackDataHandler_LoadPostData_NullCollection()
        {
            TestHtmlInputRadioButton rb   = new TestHtmlInputRadioButton();
            IPostBackDataHandler     pbdh = (rb as IPostBackDataHandler);

            pbdh.LoadPostData("id1", null);
        }
Example #2
0
        // note: this behaviour isn't present in HtmlInputControl
        public void IDversusValue()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            Assert.IsNull(rb.Value, "Value before");
            rb.ID = "id1";
            Assert.AreEqual("id1", rb.ID, "ID");
            Assert.AreEqual("id1", rb.Value, "Value after");
        }
Example #3
0
        public void RenderAttributes()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.Checked = true;
            rb.Name    = "mono";
            rb.Value   = "value";
            rb.RenderAttributes();
        }
Example #4
0
        public void RaisePostBackEvent()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.ServerChange += new EventHandler(ServerChange);
            serverChange     = false;
            rb.Raise();
            Assert.IsTrue(serverChange, "ServerClick");
        }
Example #5
0
        public void Value_ResetNull()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.Value = "a";
            rb.ID    = "id1";
            rb.Value = null;
            Assert.AreEqual("id1", rb.ID, "ID");
            Assert.AreEqual("id1", rb.Value, "Value");
        }
Example #6
0
        public void Value_Resetting()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.ID = "id1";
            Assert.AreEqual("id1", rb.Value, "Value before");
            rb.Value = "a";
            Assert.AreEqual("id1", rb.ID, "ID");
            Assert.AreEqual("a", rb.Value, "Value after");
        }
Example #7
0
        public void LoadPostData()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

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

            nvc.Add("id1", "mono");
            Assert.IsFalse(rb.LoadPost("id1", nvc), "LoadPostData");
            Assert.AreEqual("id1", rb.Value, "Value");
        }
Example #8
0
        public void IPostBackDataHandler_RaisePostBackEvent()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

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

            serverChange = false;
            pbdh.RaisePostDataChangedEvent();
            Assert.IsTrue(serverChange, "ServerChange");
        }
Example #9
0
        public void RenderValue1()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.ID = "id";
            string attrs = rb.RenderAttributes();

            Assert.IsTrue(attrs.IndexOf("value=\"id\"") >= 0);
            rb.Value = "hola<&";
            attrs    = rb.RenderAttributes();
            Assert.IsTrue(attrs.IndexOf("value=\"hola&lt;&amp;\"") >= 0);
        }
Example #10
0
        public void IPostBackDataHandler_LoadPostData_WrongId()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

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

            nvc.Add("id1", "mono");
            Assert.IsFalse(pbdh.LoadPostData("id2", nvc), "LoadPostData");
            Assert.AreEqual("id1", rb.Value, "Value");
        }
Example #11
0
        public void IPostBackDataHandler_LoadPostData()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

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

            nvc.Add("id1", "id1");
            // we didn't change the state of the control
            Assert.IsFalse(pbdh.LoadPostData("id1", nvc), "LoadPostData");
            Assert.AreEqual("id1", rb.Value, "Value");
        }
Example #12
0
		// note: this behaviour isn't present in HtmlInputControl
		public void IDversusValue ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			Assert.IsNull (rb.Value, "Value before");
			rb.ID = "id1";
			Assert.AreEqual ("id1", rb.ID, "ID");
			Assert.AreEqual ("id1", rb.Value, "Value after");
		}
Example #13
0
		public void RenderAttributes ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.Checked = true;
			rb.Name = "mono";
			rb.Value = "value";
			rb.RenderAttributes ();
		}
Example #14
0
		public void IPostBackDataHandler_LoadPostData_NullCollection ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			IPostBackDataHandler pbdh = (rb as IPostBackDataHandler);
			pbdh.LoadPostData ("id1", null);
		}
Example #15
0
		public void RenderValue1 ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ID = "id";
			string attrs = rb.RenderAttributes ();
			Assert.IsTrue (attrs.IndexOf ("value=\"id\"") >= 0);
			rb.Value = "hola<&";
			attrs = rb.RenderAttributes ();
			Assert.IsTrue (attrs.IndexOf ("value=\"hola&lt;&amp;\"") >= 0);
		}
Example #16
0
		public void Value_ResetNull ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.Value = "a";
			rb.ID = "id1";
			rb.Value = null;
			Assert.AreEqual ("id1", rb.ID, "ID");
			Assert.AreEqual ("id1", rb.Value, "Value");
		}
Example #17
0
		public void IPostBackDataHandler_LoadPostData_WrongId ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ID = "id1";
			IPostBackDataHandler pbdh = (rb as IPostBackDataHandler);
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsFalse (pbdh.LoadPostData ("id2", nvc), "LoadPostData");
			Assert.AreEqual ("id1", rb.Value, "Value");
		}
Example #18
0
		public void LoadPostData ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ID = "id1";
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsFalse (rb.LoadPost ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("id1", rb.Value, "Value");
		}
Example #19
0
		public void LoadPostData_NullCollection ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.LoadPost ("id1", null);
		}
Example #20
0
		public void RaisePostBackEvent ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ServerChange += new EventHandler (ServerChange);
			serverChange = false;
			rb.Raise ();
			Assert.IsTrue (serverChange, "ServerClick");
		}
Example #21
0
        public void LoadPostData_NullCollection()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.LoadPost("id1", null);
        }
Example #22
0
		public void IPostBackDataHandler_RaisePostBackEvent ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ServerChange += new EventHandler (ServerChange);
			IPostBackDataHandler pbdh = (rb as IPostBackDataHandler);
			serverChange = false;
			pbdh.RaisePostDataChangedEvent ();
			Assert.IsTrue (serverChange, "ServerChange");
		}
Example #23
0
		public void Value_Resetting ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ID = "id1";
			Assert.AreEqual ("id1", rb.Value, "Value before");
			rb.Value = "a";
			Assert.AreEqual ("id1", rb.ID, "ID");
			Assert.AreEqual ("a", rb.Value, "Value after");
		}
Example #24
0
		public void IPostBackDataHandler_LoadPostData ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ID = "id1";
			IPostBackDataHandler pbdh = (rb as IPostBackDataHandler);
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "id1");
			// we didn't change the state of the control
			Assert.IsFalse (pbdh.LoadPostData ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("id1", rb.Value, "Value");
		}