Author: anagappan
Date: 2006-07-25 09:38:17 -0400 (Tue, 25 Jul 2006)
New Revision: 62957

Modified:
   trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
   trunk/mcs/class/System.Data/Test/System.Data/DataViewTest2.cs
Log:
2006-07-25  Nagappan A <[EMAIL PROTECTED]>

        * DataViewTest2.cs (AcceptChanges, ClearTable): Test case to
        verify list changed event on table AcceptChanges and test case
        to verify data table count is zero on table Clear. Fixes bug
        78610. Thanks to Itai Bar-Haim <[EMAIL PROTECTED]> for the
        testcases.



Modified: trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2006-07-25 
13:16:07 UTC (rev 62956)
+++ trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2006-07-25 
13:38:17 UTC (rev 62957)
@@ -1,3 +1,11 @@
+2006-07-25  Nagappan A <[EMAIL PROTECTED]>
+
+       * DataViewTest2.cs (AcceptChanges, ClearTable): Test case to
+       verify list changed event on table AcceptChanges and test case to
+       verify data table count is zero on table Clear. Fixes bug
+       78610. Thanks to Itai Bar-Haim <[EMAIL PROTECTED]> for the
+       testcases.
+
 2006-07-20  Senganal T <[EMAIL PROTECTED]>
 
        * DataSetTest2.cs : Test exception is not raised when 

Modified: trunk/mcs/class/System.Data/Test/System.Data/DataViewTest2.cs
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/DataViewTest2.cs       
2006-07-25 13:16:07 UTC (rev 62956)
+++ trunk/mcs/class/System.Data/Test/System.Data/DataViewTest2.cs       
2006-07-25 13:38:17 UTC (rev 62957)
@@ -594,6 +594,44 @@
                        //PropertyDescriptorDeleted 
                }
 
+                [Test]
+                public void AcceptChanges ()
+                {
+                        evProp = null;
+                        DataTable dt = new DataTable ();
+                        IBindingList list = dt.DefaultView;
+                        list.ListChanged += new ListChangedEventHandler 
(dv_ListChanged);
+                        dt.Columns.Add ("test", typeof (int));
+                        dt.Rows.Add (new object[] { 10 });
+                        dt.Rows.Add (new object[] { 20 });
+                        // ListChangedType.Reset
+                        dt.AcceptChanges ();
+
+                        Assert.AreEqual(true , evProp != null , "DV166");
+                        // AcceptChanges - should emit ListChangedType.Reset
+                        Assert.AreEqual(ListChangedType.Reset , evProp.lstType 
, "DV167");
+                }
+
+                [Test]
+                public void ClearTable ()
+                {
+                        evProp = null;
+                        DataTable dt = new DataTable ();
+                        IBindingList list = dt.DefaultView;
+                        list.ListChanged += new ListChangedEventHandler 
(dv_ListChanged);
+                        dt.Columns.Add ("test", typeof (int));
+                        dt.Rows.Add (new object[] { 10 });
+                        dt.Rows.Add (new object[] { 20 });
+                        // Clears DataTable
+                        dt.Clear ();
+
+                        Assert.AreEqual(true , evProp != null , "DV168");
+                        // Clear DataTable - should emit ListChangedType.Reset
+                        
Assert.AreEqual(System.ComponentModel.ListChangedType.Reset , evProp.lstType , 
"DV169");
+                        // Clear DataTable - should clear view count
+                        Assert.AreEqual(0, dt.DefaultView.Count , "DV169");
+                }
+
                private void dv_ListChanged(object sender, 
System.ComponentModel.ListChangedEventArgs e)
                {
                        evProp = new EventProperties(); 

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

Reply via email to