示例#1
0
        public void IPostBackDataHandler_LoadPostData_NullCollection()
        {
            TestHtmlInputText    it   = new TestHtmlInputText("password");
            IPostBackDataHandler pbdh = (it as IPostBackDataHandler);

            pbdh.LoadPostData("id1", null);
        }
示例#2
0
        public void Password()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

            it.Value = "s3kr3t";
            it.ID    = "passwd";
            Assert.AreEqual("s3kr3t", it.Value, "Value");
        }
示例#3
0
        public void RaisePostBackEvent()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

            it.ServerChange += new EventHandler(ServerChange);
            serverChange     = false;
            it.Raise();
            Assert.IsTrue(serverChange, "ServerClick");
        }
示例#4
0
        public void RenderAttributes()
        {
            TestHtmlInputText it = new TestHtmlInputText();

            it.MaxLength = 4;
            it.Size      = 2;
            it.Name      = "mono";
            it.Value     = "value";
            Assert.AreEqual(" name type=\"text\" maxlength=\"4\" size=\"2\" value=\"value\" /", it.RenderAttributes());
        }
示例#5
0
        public void IPostBackDataHandler_RaisePostBackEvent()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

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

            serverChange = false;
            pbdh.RaisePostDataChangedEvent();
            Assert.IsTrue(serverChange, "ServerChange");
        }
示例#6
0
        public void LoadPostData()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

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

            nvc.Add("id1", "mono");
            Assert.IsTrue(it.LoadPost("id1", nvc), "LoadPostData");
            Assert.AreEqual("mono", it.Value, "Value");
        }
示例#7
0
        public void IPostBackDataHandler_LoadPostData()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

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

            nvc.Add("id1", "mono");
            Assert.IsTrue(pbdh.LoadPostData("id1", nvc), "LoadPostData");
            Assert.AreEqual("mono", it.Value, "Value");
        }
示例#8
0
        public void RenderAttributes_Password()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

            it.MaxLength = 2;
            it.Size      = 4;
            it.ID        = "mono";
            it.Value     = "s3kr3t";
            // value is there, maybe because a new HtmlInputPassword class exists ?
            HtmlDiff.AssertAreEqual(" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" value=\"s3kr3t\" /", it.RenderAttributes(), "Render failed");
            Assert.IsFalse(it.ViewStateValueChanged, "ViewStateValueChanged");
            Assert.IsFalse(it.AttributeValueChanged, "AttributeValueChanged");
            Assert.IsNull(it.ViewStateNewValue, "ViewStateNewValue");
            Assert.IsNull(it.AttributeNewValue, "AttributeNewValue");
        }
示例#9
0
		public void Password ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.Value = "s3kr3t";
			it.ID = "passwd";
			Assert.AreEqual ("s3kr3t", it.Value, "Value");
		}
示例#10
0
		public void RenderAttributes_Password ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.MaxLength = 2;
			it.Size = 4;
			it.ID = "mono";
			it.Value = "s3kr3t";
#if NET_2_0
			// value is there, maybe because a new HtmlInputPassword class exists ?
			HtmlDiff.AssertAreEqual (" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" value=\"s3kr3t\" /", it.RenderAttributes (),"Render failed");
			Assert.IsFalse (it.ViewStateValueChanged, "ViewStateValueChanged");
			Assert.IsFalse (it.AttributeValueChanged, "AttributeValueChanged");
#else
			HtmlDiff.AssertAreEqual(" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" /", it.RenderAttributes(),"Render failed");
			Assert.IsTrue (it.ViewStateValueChanged, "ViewStateValueChanged");
			Assert.IsTrue (it.AttributeValueChanged, "AttributeValueChanged");
#endif
			Assert.IsNull (it.ViewStateNewValue, "ViewStateNewValue");
			Assert.IsNull (it.AttributeNewValue, "AttributeNewValue");
		}
示例#11
0
        public void LoadPostData_NullCollection()
        {
            TestHtmlInputText it = new TestHtmlInputText("password");

            it.LoadPost("id1", null);
        }
示例#12
0
		public void IPostBackDataHandler_LoadPostData_NullCollection ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			IPostBackDataHandler pbdh = (it as IPostBackDataHandler);
			pbdh.LoadPostData ("id1", null);
		}
示例#13
0
		public void IPostBackDataHandler_RaisePostBackEvent ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.ServerChange += new EventHandler (ServerChange);
			IPostBackDataHandler pbdh = (it as IPostBackDataHandler);
			serverChange = false;
			pbdh.RaisePostDataChangedEvent ();
			Assert.IsTrue (serverChange, "ServerChange");
		}
示例#14
0
		public void IPostBackDataHandler_LoadPostData ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.ID = "id1";
			IPostBackDataHandler pbdh = (it as IPostBackDataHandler);
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsTrue (pbdh.LoadPostData ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("mono", it.Value, "Value");
		}
示例#15
0
		public void RaisePostBackEvent ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.ServerChange += new EventHandler (ServerChange);
			serverChange = false;
			it.Raise ();
			Assert.IsTrue (serverChange, "ServerClick");
		}
示例#16
0
		public void LoadPostData_NullCollection ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.LoadPost ("id1", null);
		}
示例#17
0
		public void RenderAttributes ()
		{
			TestHtmlInputText it = new TestHtmlInputText ();
			it.MaxLength = 4;
			it.Size = 2;
			it.Name = "mono";
			it.Value = "value";
			Assert.AreEqual (" name type=\"text\" maxlength=\"4\" size=\"2\" value=\"value\" /", it.RenderAttributes ());
		}
示例#18
0
		public void LoadPostData ()
		{
			TestHtmlInputText it = new TestHtmlInputText ("password");
			it.ID = "id1";
			NameValueCollection nvc = new NameValueCollection ();
			nvc.Add ("id1", "mono");
			Assert.IsTrue (it.LoadPost ("id1", nvc), "LoadPostData");
			Assert.AreEqual ("mono", it.Value, "Value");
		}