Bladeren bron

* ObjectDataSourceTest.cs, ObjectDataSourceViewTest.cs: removed NotWorking attributes, added test case

svn path=/trunk/mcs/; revision=67594
Vladimir Krasnov 19 jaren geleden
bovenliggende
commit
fec93cb751

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

@@ -1,3 +1,8 @@
+2006-11-09  Vladimir Krasnov  <[email protected]>
+
+	* ObjectDataSourceTest.cs, ObjectDataSourceViewTest.cs: removed
+	NotWorking attributes, added test case
+
 2006-11-09  Igor Zelmanovich   <[email protected]>
 
 	* GridViewTest.cs: added tests, removed NotWorking attributes.

+ 29 - 17
mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceTest.cs

@@ -186,7 +186,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void ObjectDataSource_NotWorkingDefaultProperties ()
 		{
 			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
@@ -246,7 +245,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void ObjectDataSource_NotWorkingAssignToDefaultProperties ()
 		{
 			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
@@ -267,11 +265,10 @@ namespace MonoTests.System.Web.UI.WebControls
 		//ViewState
 
 		[Test]
-		[Category ("NotWorking")]
 		public void ObjectDataSource_ViewState ()
 		{
 			ObjectDataSourcePoker  ods = new ObjectDataSourcePoker ();
-			InitObjectDataSource (ods,"");	
+			//InitObjectDataSource (ods,"");	
 			ObjectDataSourcePoker copy = new ObjectDataSourcePoker ();
 			FormParameter p = new FormParameter ("ID", "TextBox1");
 			p.DefaultValue = "1002";
@@ -296,7 +293,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_ConvertNullToDBNull ()
 		{
@@ -322,7 +318,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_FilterExpression ()
 		{
@@ -358,7 +353,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_FilterParameter ()
 		{
@@ -397,7 +391,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_EnablePaging ()
 		{
@@ -458,7 +451,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		//public methods
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_Delete ()
 		{
@@ -512,7 +504,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_Select ()
 		{
@@ -538,10 +529,35 @@ namespace MonoTests.System.Web.UI.WebControls
 			Assert.AreEqual ("Bansal", ((DataView) table)[2].Row.ItemArray[2], "ThirdItemData");			
 			Assert.AreEqual (true, selecting, "AfterSelectingEvent");
 			Assert.AreEqual (true, selected, "AfterSelectedEvent");
-		}
-
+		}
+
+		[Test]
+		[Category ("NunitWeb")]
+		public void ObjectDataSource_Select_Cached ()
+		{
+			string html = new WebTest (PageInvoker.CreateOnLoad (
+				new PageDelegate (SelectMethodCached))).Run ();
+		}
+
+
+		public static void SelectMethodCached (Page p)
+		{
+			MyTableObject.ds = MyTableObject.CreateDataTable ();
+			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
+			ods.EnableCaching = true;
+			InitObjectDataSource (ods, "");
+			p.Controls.Add (ods);
+			ods.Selecting += new ObjectDataSourceSelectingEventHandler (odc_Selecting);
+
+			selecting = false;
+			IEnumerable table = (IEnumerable) ods.Select ();
+			Assert.AreEqual (true, selecting, "AfterSelectingEvent");
+
+			selecting = false;
+			IEnumerable table2 = (IEnumerable) ods.Select ();
+			Assert.AreEqual (false, selecting, "AfterSelectingEvent");
+		}
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_Insert ()
 		{
@@ -570,7 +586,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_Update ()
 		{
@@ -621,7 +636,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		// Tests for events Select,Update,Delete and Insert include in Select,Update,Delete and Insert methods tests.
 
 		[Test]
-		[Category ("NotWorking")]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_Events ()
 		{
@@ -719,7 +733,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		//Excpetions
 
 		[Test]
-		[Category ("NotWorking")]
 		[ExpectedException (typeof (NotSupportedException))]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_EnableCachingException ()
@@ -742,7 +755,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		[ExpectedException (typeof (NotSupportedException))]
 		[Category ("NunitWeb")]
 		public void ObjectDataSource_FilterExpressionException ()

+ 1 - 9
mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceViewTest.cs

@@ -191,7 +191,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void DefaultsNotWorking ()
 		{
 			ObjectDataSource ds = new ObjectDataSource ();
@@ -253,7 +252,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void ViewState ()
 		{
 			// Note :
@@ -391,13 +389,11 @@ namespace MonoTests.System.Web.UI.WebControls
 
 		[Test]
 		[Category("NunitWeb")]
-		[Category ("NotWorking")]
 		public void DeleteMethod ()
 		{
 			WebTest t = new WebTest (PageInvoker.CreateOnLoad (delete));
 			string html = t.Run ();
-			string origin = @"<div></div>";
-			HtmlDiff.AssertAreEqual (origin, HtmlDiff.GetControlFromPageHtml (html), "ObjectDataSourceViewDelete");
+			Assert.AreEqual (-1, html.IndexOf("Yonik"), "ObjectDataSourceViewDelete");
 			WebTest.Unload ();
 		}
 
@@ -448,7 +444,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
 		[Test]
 		[Category ("NunitWeb")]
-		[Category ("NotWorking")]
 		public void SelectMethod ()
 		{
 			WebTest t = new WebTest (PageInvoker.CreateOnLoad (select));
@@ -497,7 +492,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
 		[Test]
 		[Category ("NunitWeb")]
-		[Category ("NotWorking")]
 		public void SelectCountMethod ()
 		{
 			// This method will render grid view with paging 
@@ -556,7 +550,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
 		[Test]
 		[Category ("NunitWeb")]
-		[Category ("NotWorking")]
 		public void InsertMethod ()
 		{
 			WebTest t = new WebTest (PageInvoker.CreateOnLoad (insert));
@@ -622,7 +615,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
 		[Test]
 		[Category ("NunitWeb")]
-		[Category ("NotWorking")]
 		public void UpdateMethod ()
 		{
 			WebTest t = new WebTest (PageInvoker.CreateOnLoad (update));