public static void AppRelativeTemplateSourceDirectory_Load(Page p)
        {
            PokerImageButton i = new PokerImageButton();

            i.ID = "I";
            Assert.AreEqual("~/", i.AppRelativeTemplateSourceDirectory, "AppRelativeTemplateSourceDirectory");
        }
        public static void RaisePostBackEvent_Load(Page p)
        {
            PokerImageButton b = new PokerImageButton();

            p.Form.Controls.Add(b);
            b.Click   += new ImageClickEventHandler(b_Click);
            b.Command += new CommandEventHandler(b_Command);
            b.RaisePostBackEvent("Click");
        }
Exemple #3
0
        public void Text()
        {
            PokerImageButton b = new PokerImageButton();

            b.Text = "MyText";
            string html = b.Render();

            HtmlDiff.AssertAreEqual("<input type=\"image\" src=\"\" alt=\"MyText\" style=\"border-width:0px;\" />", html, "Text#1");
        }
        public static void PostBackUrl_load(Page p)
        {
            PokerImageButton b = new PokerImageButton();

            p.Form.Controls.Add(new LiteralControl(HtmlDiff.BEGIN_TAG));
            p.Form.Controls.Add(b);
            p.Form.Controls.Add(new LiteralControl(HtmlDiff.END_TAG));
            b.PostBackUrl = "~/MyURL.aspx";
        }
Exemple #5
0
        public void Text()
        {
            string           origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" />";
            PokerImageButton b        = new PokerImageButton();

            b.Text = "MyText";
            string html = b.Render();

            HtmlDiff.AssertAreEqual(origHtml, html, "Text#1");
        }
        public void Text()
        {
#if NET_4_0
            string origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" />";
#else
            string origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" style=\"border-width:0px;\" />";
#endif
            PokerImageButton b = new PokerImageButton();
            b.Text = "MyText";
            string html = b.Render();
            HtmlDiff.AssertAreEqual(origHtml, html, "Text#1");
        }
        public void OnClientClick()
        {
            PokerImageButton b = new PokerImageButton();

            b.OnClientClick = "MyMethod";
            string html = b.Render();

            if (html.IndexOf("onclick=\"MyMethod;\"") == -1)
            {
                Assert.Fail("OnClientClick#1");
            }
        }
        public void DescriptionUrl()
        {
            PokerImageButton i = new PokerImageButton();

            i.DescriptionUrl = "URLDescription";
            string html = i.Render();

            if (html.IndexOf("longdesc=\"URLDescription\"") == -1)
            {
                Assert.Fail("DescriptionUrl Failed");
            }
        }
        [Test] // Bug #463939
        public void OnClientClickEmpty()
        {
            PokerImageButton b    = new PokerImageButton();
            string           html = b.Render();

            Assert.AreEqual(-1, html.IndexOf("onclick=\""), "#A1");

            b.OnClientClick = String.Empty;
            html            = b.Render();
            Assert.AreEqual(-1, html.IndexOf("onclick=\""), "#A2");

            b.OnClientClick = null;
            html            = b.Render();
            Assert.AreEqual(-1, html.IndexOf("onclick=\""), "#A3");
        }
        public static void ValidationGroup_Load(Page p)
        {
            PokerImageButton b = new PokerImageButton();

            b.ValidationGroup = "MyValidationGroup";
            TextBox tb = new TextBox();

            tb.ID = "tb";
            tb.ValidationGroup = "MyValidationGroup";
            RequiredFieldValidator v = new RequiredFieldValidator();

            v.ControlToValidate = "tb";
            v.ValidationGroup   = "MyValidationGroup";
            p.Form.Controls.Add(tb);
            p.Form.Controls.Add(v);
            p.Form.Controls.Add(new LiteralControl(HtmlDiff.BEGIN_TAG));
            p.Form.Controls.Add(b);
            p.Form.Controls.Add(new LiteralControl(HtmlDiff.END_TAG));
        }
Exemple #11
0
        public void ImageButton_ViewState()
        {
            PokerImageButton p = new PokerImageButton();

            p.CommandArgument = "arg";
            Assert.AreEqual(p.CommandArgument, "arg", "A1");
            p.CommandName = "cmd";
            Assert.AreEqual(p.CommandName, "cmd", "A2");
            p.ValidationGroup = "VG1";
            Assert.AreEqual(p.ValidationGroup, "VG1", "A3");

            object state = p.SaveState();

            PokerImageButton copy = new PokerImageButton();

            copy.LoadState(state);

            Assert.AreEqual(copy.CommandArgument, "arg", "A4");
            Assert.AreEqual(copy.CommandName, "cmd", "A5");
            Assert.AreEqual(copy.ValidationGroup, "VG1", "A6");
        }
Exemple #12
0
		public static void PostBackUrl_load (Page p)
		{
			PokerImageButton b = new PokerImageButton ();
			p.Form.Controls.Add (new LiteralControl(HtmlDiff.BEGIN_TAG));
			p.Form.Controls.Add (b);
			p.Form.Controls.Add (new LiteralControl (HtmlDiff.END_TAG));
			b.PostBackUrl = "~/MyURL.aspx";
		}
Exemple #13
0
		[Test] // Bug #463939
		public void OnClientClickEmpty ()
		{
			PokerImageButton b = new PokerImageButton ();
			string html = b.Render ();
			Assert.AreEqual (-1, html.IndexOf ("onclick=\""), "#A1");

			b.OnClientClick = String.Empty;
			html = b.Render ();
			Assert.AreEqual (-1, html.IndexOf ("onclick=\""), "#A2");

			b.OnClientClick = null;
			html = b.Render ();
			Assert.AreEqual (-1, html.IndexOf ("onclick=\""), "#A3");
		}
Exemple #14
0
		public void OnClientClick ()
		{
			PokerImageButton b = new PokerImageButton ();
			b.OnClientClick = "MyMethod";
			string html = b.Render ();
			if (html.IndexOf ("onclick=\"MyMethod;\"") == -1)
				Assert.Fail ("OnClientClick#1");
		}
Exemple #15
0
		public void DescriptionUrl ()
		{
			PokerImageButton i = new PokerImageButton ();
			i.DescriptionUrl = "URLDescription";
			string html = i.Render ();
			if (html.IndexOf ("longdesc=\"URLDescription\"") == -1)
				Assert.Fail ("DescriptionUrl Failed");
		}
Exemple #16
0
		public static void AppRelativeTemplateSourceDirectory_Load (Page p)
		{
			PokerImageButton i = new PokerImageButton ();
			i.ID = "I";
			Assert.AreEqual ("~/", i.AppRelativeTemplateSourceDirectory, "AppRelativeTemplateSourceDirectory");
		}
Exemple #17
0
		public static void RaisePostBackEvent_Load (Page p)
		{
			PokerImageButton b = new PokerImageButton ();
			p.Form.Controls.Add (b);
			b.Click += new ImageClickEventHandler (b_Click);
			b.Command += new CommandEventHandler (b_Command);
			b.RaisePostBackEvent ("Click");
		}
Exemple #18
0
		public static void ValidationGroup_Load(Page p)
		{
			PokerImageButton b = new PokerImageButton ();
			b.ValidationGroup = "MyValidationGroup";
			TextBox tb = new TextBox ();
			tb.ID = "tb";
			tb.ValidationGroup = "MyValidationGroup";
			RequiredFieldValidator v = new RequiredFieldValidator ();
			v.ControlToValidate = "tb";
			v.ValidationGroup = "MyValidationGroup";
			p.Form.Controls.Add (tb);
			p.Form.Controls.Add (v);
			p.Form.Controls.Add (new LiteralControl (HtmlDiff.BEGIN_TAG));
			p.Form.Controls.Add (b);
			p.Form.Controls.Add (new LiteralControl (HtmlDiff.END_TAG));
		}
Exemple #19
0
		public void Text ()
		{
#if NET_4_0
			string origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" />";
#else
			string origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" style=\"border-width:0px;\" />";
#endif
			PokerImageButton b = new PokerImageButton ();
			b.Text = "MyText";
			string html = b.Render ();
			HtmlDiff.AssertAreEqual (origHtml, html, "Text#1");
		}
Exemple #20
0
		public void Text ()
		{
			string origHtml = "<input type=\"image\" src=\"\" alt=\"MyText\" />";
			PokerImageButton b = new PokerImageButton ();
			b.Text = "MyText";
			string html = b.Render ();
			HtmlDiff.AssertAreEqual (origHtml, html, "Text#1");
		}
Exemple #21
0
		public void ImageButton_ViewState ()
		{
			PokerImageButton p = new PokerImageButton ();

			p.CommandArgument = "arg";
			Assert.AreEqual (p.CommandArgument, "arg", "A1");
			p.CommandName = "cmd";
			Assert.AreEqual (p.CommandName, "cmd", "A2");
#if NET_2_0
			p.ValidationGroup = "VG1";
			Assert.AreEqual (p.ValidationGroup, "VG1", "A3");
#endif

			object state = p.SaveState ();

			PokerImageButton copy = new PokerImageButton ();
			copy.LoadState (state);

			Assert.AreEqual (copy.CommandArgument, "arg", "A4");
			Assert.AreEqual (copy.CommandName, "cmd", "A5");
#if NET_2_0
			Assert.AreEqual (copy.ValidationGroup, "VG1", "A6");
#endif

		}
		public void Text ()
		{
			PokerImageButton b = new PokerImageButton ();
			b.Text = "MyText";
			string html = b.Render ();
			HtmlDiff.AssertAreEqual ("<input type=\"image\" src=\"\" alt=\"MyText\" style=\"border-width:0px;\" />", html, "Text#1");
		}