Browse Source

more precise lifetime flow checks

svn path=/trunk/mcs/; revision=62821
Andrew Skiba 19 năm trước cách đây
mục cha
commit
6f78458bbe

+ 4 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,7 @@
+2006-07-20 Andrew Skiba <[email protected]>
+
+	* DetailsViewTest.cs: more precise lifetime flow check.
+
 2006-07-20 Andrew Skiba <[email protected]>
 
 	* DetailsViewTest.cs: add EnsureChildControls basic test.

+ 17 - 1
mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs

@@ -55,7 +55,9 @@ namespace MonoTests.System.Web.UI.WebControls
 			public bool ensureDataBound=false;
 			public bool isInitializePager = false;
 			public bool controlHierarchy = false;
-			public bool ensureCreateChildControls = false;
+			public bool ensureCreateChildControls = false;
+			public bool createChildControls1 = false;
+			public bool createChildControls2 = false;
 			public PokerDetailsView () 
 			{
 			 TrackViewState ();
@@ -224,6 +226,18 @@ namespace MonoTests.System.Web.UI.WebControls
 			{
 				base.EnsureChildControls ();
 				ensureCreateChildControls = true;
+			}
+
+			protected override void CreateChildControls ()
+			{
+				base.CreateChildControls ();
+				createChildControls1 = true;
+			}
+
+			protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+			{
+				return base.CreateChildControls (data, dataBinding);
+				createChildControls2 = true;
 			}
 
 			public void DoConfirmInitState ()
@@ -858,6 +872,8 @@ namespace MonoTests.System.Web.UI.WebControls
 			int i = dv.Rows.Count;
 			Assert.IsTrue (dv.ensureCreateChildControls);
 			Assert.IsFalse (dv.ensureDataBound);
+			Assert.IsFalse (dv.createChildControls1);
+			Assert.IsFalse (dv.createChildControls2);
 		}
 
 		[Test]