Example #1
0
        public void Defaults()
        {
            HtmlButtonPoker p = new HtmlButtonPoker();

            Assert.IsTrue(p.CausesValidation, "A1");
            Assert.AreEqual("", p.ValidationGroup, "A2");
        }
Example #2
0
		public void Defaults ()
		{
			HtmlButtonPoker p = new HtmlButtonPoker ();

			Assert.IsTrue (p.CausesValidation, "A1");
			Assert.AreEqual ("", p.ValidationGroup, "A2");
		}
        public void CleanProperties()
        {
            HtmlButtonPoker p = new HtmlButtonPoker();

            p.CausesValidation = false;
            Assert.IsFalse(p.CausesValidation, "A1");

            p.CausesValidation = true;
            Assert.IsTrue(p.CausesValidation, "A2");

            p.CausesValidation = false;
            Assert.IsFalse(p.CausesValidation, "A3");
        }
Example #4
0
		public void CleanProperties ()
		{
			HtmlButtonPoker p = new HtmlButtonPoker ();

			p.CausesValidation = false;
			Assert.IsFalse (p.CausesValidation, "A1");

			p.CausesValidation = true;
			Assert.IsTrue (p.CausesValidation, "A2");

			p.CausesValidation = false;
			Assert.IsFalse (p.CausesValidation, "A3");
		}
Example #5
0
        public void ViewState()
        {
            HtmlButtonPoker p = new HtmlButtonPoker();

            p.CausesValidation = true;
            p.ValidationGroup  = "VG";
            object state = p.SaveState();

            HtmlButtonPoker copy = new HtmlButtonPoker();

            copy.LoadState(state);
            Assert.AreEqual("VG", copy.ValidationGroup, "A1");
            Assert.IsTrue(copy.CausesValidation, "A2");
        }
        public void RenderAttributes()
        {
            StringWriter   sw = new StringWriter();
            HtmlTextWriter tw = new HtmlTextWriter(sw);

            HtmlButtonPoker p = new HtmlButtonPoker();

            Assert.AreEqual(p.Attributes.Count, 0, "A1");

            p.DoRenderAttributes(tw);
            Assert.AreEqual(sw.ToString(), String.Empty, "A2");

            p.ServerClick += new EventHandler(EmptyHandler);

            p.DoRenderAttributes(tw);
            // This is empty because the control doesn't have
            // its Page property initialized
            Assert.AreEqual(sw.ToString(), String.Empty, "A3");
        }
Example #7
0
		public void ViewState ()
		{
			HtmlButtonPoker p = new HtmlButtonPoker ();
			p.CausesValidation = true;
#if NET_2_0
			p.ValidationGroup = "VG";
#endif
			object state = p.SaveState();

			HtmlButtonPoker copy = new HtmlButtonPoker ();
			copy.LoadState (state);
#if NET_2_0
			Assert.AreEqual ("VG", copy.ValidationGroup, "A1");
#endif
			Assert.IsTrue (copy.CausesValidation, "A2");
		}
Example #8
0
		public void RenderAttributes ()
		{
			StringWriter sw = new StringWriter ();
			HtmlTextWriter tw = new HtmlTextWriter (sw);

			HtmlButtonPoker p = new HtmlButtonPoker ();

			Assert.AreEqual (p.Attributes.Count, 0, "A1");

			p.DoRenderAttributes (tw);
			Assert.AreEqual (sw.ToString (), String.Empty, "A2");

			p.ServerClick += new EventHandler (EmptyHandler);

			p.DoRenderAttributes (tw);
			// This is empty because the control doesn't have
			// its Page property initialized
			Assert.AreEqual (sw.ToString (), String.Empty, "A3");
		}