Explorar o código

2005-09-28 Gonzalo Paniagua Javier <[email protected]>

	* DataGridTest.cs: fixed a test and added a commented out one that works
	fine in mono but throws nullref with MS.


svn path=/trunk/mcs/; revision=50920
Gonzalo Paniagua Javier %!s(int64=20) %!d(string=hai) anos
pai
achega
bcf38cbfbb

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

@@ -1,3 +1,8 @@
+2005-09-28 Gonzalo Paniagua Javier <[email protected]>
+
+	* DataGridTest.cs: fixed a test and added a commented out one that works
+	fine in mono but throws nullref with MS.
+
 2005-09-27 Gonzalo Paniagua Javier <[email protected]>
 
 	* DataGridTest.cs: more tests that add a TemplateColumn.

+ 22 - 7
mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs

@@ -55,11 +55,6 @@ namespace MonoTests.System.Web.UI.WebControls {
 			return TagName;
 		}
 
-		public void CreateCH (bool use_ds)
-		{
-			CreateControlHierarchy (use_ds);
-		}
-
 		public void PrepareCH ()
 		{
 			PrepareControlHierarchy ();
@@ -1348,9 +1343,10 @@ namespace MonoTests.System.Web.UI.WebControls {
 			TemplateColumn tc = new TemplateColumn ();
 			tc.ItemTemplate = new MyTemplate ("hola");
 			p.Columns.Add (tc);
+			ControlCollection controls = p.Controls;
 			p.CreateControls (true);
 			Assert.AreEqual (1, p.Columns.Count, "columns");
-			Assert.AreEqual (0, p.Controls.Count, "controls");
+			Assert.AreEqual (0, controls.Count, "controls");
 			string render = p.Render ();
 			// no items, even with a templated column.
 			// The table is not added if DataSource == null
@@ -1370,7 +1366,7 @@ namespace MonoTests.System.Web.UI.WebControls {
 			p.Columns.Add (tc);
 			Assert.AreEqual (1, p.Columns.Count, "columns-1");
 			Assert.AreEqual (0, p.Controls.Count, "controls-1");
-			p.CreateCH (true);
+			p.CreateControls (true);
 			// This time we have the table there. Thanks to the empty ArrayList
 			Assert.AreEqual (1, p.Columns.Count, "columns-2");
 			Assert.AreEqual (1, p.Controls.Count, "controls-2");
@@ -1401,6 +1397,25 @@ namespace MonoTests.System.Web.UI.WebControls {
 			Assert.IsTrue (-1 != render.IndexOf ("hola"), "template");
 		}
 
+		/* This one throw nullref on MS and works with mono
+		* [Test]
+		* public void OneTemplateColumn4 ()
+		{
+			DataGridPoker p = new DataGridPoker ();
+			TemplateColumn tc = new TemplateColumn ();
+			tc.ItemTemplate = new MyTemplate ("hola");
+			p.Columns.Add (tc);
+			p.DataSource = new ArrayList ();
+			p.CreateControls (false);
+			Assert.AreEqual (1, p.Columns.Count, "columns");
+			// Table added because useDataSource == false...
+			Assert.AreEqual (1, p.Controls.Count, "controls");
+			string render = p.Render ();
+			// ... but no template rendered.
+			Assert.IsTrue (-1 == render.IndexOf ("hola"), "template");
+		}
+		*/
+
 		[Test]
 		public void CreateControls ()
 		{