Exemplo n.º 1
0
        public void IPostBackDataHandler_LoadPostData_NullCollection()
        {
            TestHtmlInputRadioButton rb   = new TestHtmlInputRadioButton();
            IPostBackDataHandler     pbdh = (rb as IPostBackDataHandler);

            pbdh.LoadPostData("id1", null);
        }
Exemplo n.º 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");
        }
Exemplo n.º 3
0
        public void RenderAttributes()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

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

            rb.ServerChange += new EventHandler(ServerChange);
            serverChange     = false;
            rb.Raise();
            Assert.IsTrue(serverChange, "ServerClick");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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");
		}
Exemplo n.º 13
0
		public void RenderAttributes ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.Checked = true;
			rb.Name = "mono";
			rb.Value = "value";
			rb.RenderAttributes ();
		}
Exemplo n.º 14
0
		public void IPostBackDataHandler_LoadPostData_NullCollection ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			IPostBackDataHandler pbdh = (rb as IPostBackDataHandler);
			pbdh.LoadPostData ("id1", null);
		}
Exemplo n.º 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);
		}
Exemplo n.º 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");
		}
Exemplo n.º 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");
		}
Exemplo n.º 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");
		}
Exemplo n.º 19
0
		public void LoadPostData_NullCollection ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.LoadPost ("id1", null);
		}
Exemplo n.º 20
0
		public void RaisePostBackEvent ()
		{
			TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton ();
			rb.ServerChange += new EventHandler (ServerChange);
			serverChange = false;
			rb.Raise ();
			Assert.IsTrue (serverChange, "ServerClick");
		}
Exemplo n.º 21
0
        public void LoadPostData_NullCollection()
        {
            TestHtmlInputRadioButton rb = new TestHtmlInputRadioButton();

            rb.LoadPost("id1", null);
        }
Exemplo n.º 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");
		}
Exemplo n.º 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");
		}
Exemplo n.º 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");
		}