Author: yonik
Date: 2006-09-26 08:06:04 -0400 (Tue, 26 Sep 2006)
New Revision: 65914
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs
Log:
Add new tests to CheckBoxTest.cs net_2_0 category
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2006-09-26 11:30:56 UTC (rev 65913)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2006-09-26 12:06:04 UTC (rev 65914)
@@ -1,3 +1,7 @@
+2006-09-26 Yoni Klain <[EMAIL PROTECTED]>
+
+ * CheckBoxTest.cs: Some new tests was added.
+
2006-09-25 Igor Zelmanovich <[EMAIL PROTECTED]>
* DataBoundControlTest.cs: New test was added
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs
2006-09-26 11:30:56 UTC (rev 65913)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs
2006-09-26 12:06:04 UTC (rev 65914)
@@ -4,6 +4,7 @@
//
// Author:
// Dick Porter <[EMAIL PROTECTED]>
+// Yoni Klain <[EMAIL PROTECTED]>
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
@@ -75,7 +76,36 @@
((IPostBackDataHandler) this).LoadPostData ("mykey",
nvc);
}
+ }
+
+ public class PokerCheckBox : CheckBox
+ {
+ private bool checker;
+ public bool Checker
+ {
+ get { return checker; }
+ }
+
+ public void Reset ()
+ {
+ checker = false;
+ }
+ public string Render ()
+ {
+ HtmlTextWriter writer = new HtmlTextWriter (new
StringWriter ());
+ base.Render (writer);
+ return writer.InnerWriter.ToString ();
+ }
+
+ override protected void AddAttributesToRender (HtmlTextWriter
writer)
+ {
+ Reset ();
+ base.AddAttributesToRender (writer);
+ writer.AddAttribute ("Attribute", "AttributeValue");
+ writer.AddStyleAttribute ("StyleAttribute",
"StyleAttValue");
+ checker = true;
+ }
}
[TestFixture]
@@ -100,8 +130,62 @@
Assert.AreEqual (String.Empty, c.ValidationGroup,
"ValidationGroup");
#endif
}
+#if NET_2_0
+ [Test]
+ [Category ("NotWorking")]
+ public void InputAttributesTest ()
+ {
+ TestCheckBox c = new TestCheckBox ();
+ c.InputAttributes.Add ("Atribute", "Test");
+ string html = c.Render ();
+ Assert.AreEqual ("<input type=\"checkbox\"
Atribute=\"Test\" />", html, "Input Attribute fail");
+ }
+
[Test]
+ [Category ("NotWorking")]
+ public void LabelAttributesTest_1 ()
+ {
+ TestCheckBox c = new TestCheckBox ();
+ c.Text = "CheckBoxText";
+ c.LabelAttributes.Add ("Atribute", "Test");
+ string html = c.Render ();
+ Assert.AreEqual ("<input type=\"checkbox\" /><label for
Atribute=\"Test\">CheckBoxText</label>", html, "Label Attributes fail#1");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void LabelAttributesTest_2 ()
+ {
+ TestCheckBox c = new TestCheckBox ();
+ c.LabelAttributes.Add ("Atribute", "Test");
+ string html = c.Render ();
+ Assert.AreEqual ("<input type=\"checkbox\" />", html,
"Label Attributes fail#2");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void AddAttributesToRenderTest_1 ()
+ {
+ PokerCheckBox c = new PokerCheckBox ();
+ c.Text = "CheckBoxText";
+ string html = c.Render ();
+ Assert.AreEqual (true, c.Checker,
"AddAttributesToRender dosn't called fail");
+ Assert.AreEqual ("<input Attribute=\"AttributeValue\"
type=\"checkbox\" style=\"StyleAttribute:StyleAttValue;\" /><label
for>CheckBoxText</label>", html, "Add Attributes To Render fail#1");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void AddAttributesToRenderTest_2 ()
+ {
+ PokerCheckBox c = new PokerCheckBox ();
+ string html = c.Render ();
+ Assert.AreEqual (true, c.Checker,
"AddAttributesToRender dosn't called fail");
+ Assert.AreEqual ("<input Attribute=\"AttributeValue\"
type=\"checkbox\" style=\"StyleAttribute:StyleAttValue;\" />", html, "Add
Attributes To Render fail#2");
+ }
+#endif
+
+ [Test]
public void NullProperties ()
{
TestCheckBox c = new TestCheckBox ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches