Author: gert
Date: 2007-08-23 11:24:41 -0400 (Thu, 23 Aug 2007)
New Revision: 84705

Modified:
   trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
Log:
* ControlTest.cs: Added test for bug #82546. Spaces to tabs.


Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog     2007-08-23 
15:22:57 UTC (rev 84704)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog     2007-08-23 
15:24:41 UTC (rev 84705)
@@ -1,8 +1,11 @@
-2007-08-06 Igor Zelmanovich <[EMAIL PROTECTED]>
+2007-08-23  Gert Driesen  <[EMAIL PROTECTED]>
 
-       * ControlTest.cs:
-       Added new tests.
+       * ControlTest.cs: Added test for bug #82546. Spaces to tabs.
 
+2007-08-06  Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * ControlTest.cs: Added new tests.
+
 2007-06-15  Gert Driesen  <[EMAIL PROTECTED]>
 
        * LosFormatterTest.cs: Added tests for LosFormatter.

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs        
2007-08-23 15:22:57 UTC (rev 84704)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs        
2007-08-23 15:24:41 UTC (rev 84705)
@@ -64,6 +64,54 @@
                        Assert.AreEqual (true, ((IDataBindingsAccessor) 
c).HasDataBindings);
                }
 
+               [Test] // bug #82546
+               public void FindControl_NamingContainer ()
+               {
+                       Control topControl = new NamingContainer ();
+                       topControl.ID = "top";
+
+                       Control controlLevel1A = new Control ();
+                       controlLevel1A.ID = "Level1#A";
+                       topControl.Controls.Add (controlLevel1A);
+
+                       Control controlLevel1B = new Control ();
+                       controlLevel1B.ID = "Level1#B";
+                       topControl.Controls.Add (controlLevel1B);
+
+                       Control controlLevel2AA = new Control ();
+                       controlLevel2AA.ID = "Level2#AA";
+                       controlLevel1A.Controls.Add (controlLevel2AA);
+
+                       Control controlLevel2AB = new Control ();
+                       controlLevel2AB.ID = "Level2#AB";
+                       controlLevel1A.Controls.Add (controlLevel2AB);
+
+                       Control foundControl = topControl.FindControl 
("Level1#A");
+                       Assert.IsNotNull (foundControl, "#A1");
+                       Assert.AreSame (controlLevel1A, foundControl, "#A2");
+
+                       foundControl = topControl.FindControl ("LEVEL1#B");
+                       Assert.IsNotNull (foundControl, "#B1");
+                       Assert.AreSame (controlLevel1B, foundControl, "#B2");
+
+                       foundControl = topControl.FindControl ("LeVeL2#AB");
+                       Assert.IsNotNull (foundControl, "#C1");
+                       Assert.AreSame (controlLevel2AB, foundControl, "#C2");
+
+                       foundControl = topControl.FindControl ("doesnotexist");
+                       Assert.IsNull (foundControl, "#D1");
+                       foundControl = topControl.FindControl ("top");
+                       Assert.IsNull (foundControl, "#D2");
+
+                       foundControl = controlLevel1A.FindControl ("Level2#AA");
+                       Assert.IsNotNull (foundControl, "#E1");
+                       Assert.AreSame (controlLevel2AA, foundControl, "#E2");
+
+                       foundControl = controlLevel1A.FindControl ("LEveL2#ab");
+                       Assert.IsNotNull (foundControl, "#F1");
+                       Assert.AreSame (controlLevel2AB, foundControl, "#F2");
+               }
+
                [Test]
                public void UniqueID1 ()
                {
@@ -231,16 +279,16 @@
                [Category("NunitWeb")]
                public void AppRelativeTemplateSourceDirectory ()
                {
-                           new 
WebTest(PageInvoker.CreateOnLoad(AppRelativeTemplateSourceDirectory_Load)).Run();
+                       new 
WebTest(PageInvoker.CreateOnLoad(AppRelativeTemplateSourceDirectory_Load)).Run();
                }
                
                public static void AppRelativeTemplateSourceDirectory_Load(Page 
p)
                {
-                           Control ctrl = new Control();
-                           Assert.AreEqual("~/", 
ctrl.AppRelativeTemplateSourceDirectory, 
"AppRelativeTemplateSourceDirectory#1");
-                           ctrl.AppRelativeTemplateSourceDirectory = "~/Fake";
-                           Assert.AreEqual("~/Fake", 
ctrl.AppRelativeTemplateSourceDirectory, 
"AppRelativeTemplateSourceDirectory#2");
-               }
+                       Control ctrl = new Control();
+                       Assert.AreEqual("~/", 
ctrl.AppRelativeTemplateSourceDirectory, 
"AppRelativeTemplateSourceDirectory#1");
+                       ctrl.AppRelativeTemplateSourceDirectory = "~/Fake";
+                       Assert.AreEqual("~/Fake", 
ctrl.AppRelativeTemplateSourceDirectory, 
"AppRelativeTemplateSourceDirectory#2");
+               }
 
                [Test]
                public void ApplyStyleSheetSkin ()
@@ -895,6 +943,7 @@
                        // cause CreateChildControls called
                        c.FindControl ("stam");
                }
+
                static void BindingContainer_BuildTemplate (Control control)
                {
                        Control child1 = new Control ();
@@ -1159,8 +1208,3 @@
                }
        }
 }
-
-
-
-
-

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to