Update mobile tests
authorMarek Safar <marek.safar@gmail.com>
Thu, 7 Mar 2013 15:33:44 +0000 (16:33 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 7 Mar 2013 15:34:24 +0000 (16:34 +0100)
39 files changed:
mcs/class/System.Data/System.Data.Common/DataAdapter.cs
mcs/class/System.Data/Test/System.Data.Common/ConnectionStringsSectionTest.cs
mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs
mcs/class/System.Data/Test/System.Data.Common/DbProviderFactoriesConfigurationHandlerTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlDataAdapterTest.cs
mcs/class/System.Data/Test/System.Data.Test.Utils/DataProvider.cs
mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs
mcs/class/System.Data/Test/System.Data/ConstraintTest.cs
mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs
mcs/class/System.Data/Test/System.Data/DataRelationTest.cs
mcs/class/System.Data/Test/System.Data/DataSet1.Designer.cs
mcs/class/System.Data/Test/System.Data/DataSetTest.cs
mcs/class/System.Data/Test/System.Data/DataSetTest2.cs
mcs/class/System.Data/Test/System.Data/DataTableTest.cs
mcs/class/System.Data/Test/System.Data/DataTableTest4.cs
mcs/class/System.Data/Test/System.Data/DataViewManagerTest.cs
mcs/class/System.Data/Test/System.Data/TypedDataSetGeneratorTest.cs
mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs
mcs/class/System.Data/Test/System.Data/XmlDataReaderTest.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug666333Test.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/WsdlHelper.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs
mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlBinaryDictionaryWriterTest.cs
mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs
mcs/class/System.Transactions/Test/EnlistTest.cs
mcs/class/System.Transactions/Test/TransactionScopeTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionImporterTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionReflectorTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/WebReferenceOptionsTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/WebReferenceTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/WebServicesInteroperabilityTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/LogicalMethodInfoTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SoapServerTypeTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services/WebMethodAttributeTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services/WebServiceTest.cs

index b82e7ceaccb4b9ecd8a8a257af0bb21215c18fea..99fbda2d578c02878a130a30c6eaa71d5fdba5ed 100644 (file)
@@ -215,7 +215,6 @@ namespace System.Data.Common
                [MonoTODO]
                protected override void Dispose (bool disposing)
                {
-                       throw new NotImplementedException ();
                }
 
                protected virtual bool ShouldSerializeTableMappings ()
index b1dbb367721452f485d00083847b330924da412b..9722b5be1b7b10e177eb1280962abd7efa3dc161 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-#region Using directives
+#if !MOBILE
 
 using System;
 using System.Configuration;
 
 using NUnit.Framework;
 
-#endregion
-
 namespace MonoTests.System.Configuration
 {
     [TestFixture]
@@ -63,4 +59,4 @@ namespace MonoTests.System.Configuration
 
 
 }
-#endif // NET_2_0
+#endif
index 96dd9b84aaab7711c6fdff93227a4fdcdcfe9c64..c857af2d64bb4307cc1d34266be248121d6215a6 100644 (file)
@@ -32,7 +32,9 @@ using System.Data.Common;
 using System.Data.SqlClient;
 
 /*--For Bug 853 Test Begin--*/
+#if !MOBILE
 using Mono.Data.Sqlite;
+#endif
 /*--For Bug 853 Test End--*/
 
 using NUnit.Framework;
@@ -184,7 +186,7 @@ namespace MonoTests.System.Data.Common
                                Assert.IsNotNull (ex.Message, "#4");
                        }
                }
-               
+#if !MOBILE    
                [Test]
                [Category ("NotWorking")] // Requires newer sqlite than is on wrench
                public void XimarinBugzillaBug853Test()
@@ -221,6 +223,7 @@ sqliteDataAdapter.Update (dataSet, "Primus");
                         dbConnection.Close();
                         dbConnection = null;
                }
+#endif
 
 #endif
 
index abee0df6d7e5d9d74d60d984405262bf332de960..fe239ea4fb92fa9d65a9e2849dfcff0e43a46430 100644 (file)
@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+#if !MOBILE
 
 using System.IO;
 using System.Xml;
@@ -113,4 +113,4 @@ namespace MonoTests.System.Data.Common
        }
 }
 
-#endif // NET_2_0
+#endif
index fc76ab049c9da1e61977be29f5e9041dffbbdbaf..cb3a4b750e13a18588f511db932f00ace7bbac1e 100644 (file)
 
 using System;
 using System.Data;
-using System.Data.Odbc;
 using System.Data.SqlClient;
+#if !MOBILE
+using System.Data.Odbc;
+#endif
 
 using NUnit.Framework;
 
@@ -362,30 +364,6 @@ namespace MonoTests.System.Data.SqlClient
                        Assert.IsNull (da.DeleteCommand, "#3");
                }
 
-               [Test]
-               public void DeleteCommand_IDbDataAdapter ()
-               {
-                       IDbDataAdapter da = new SqlDataAdapter ();
-                       SqlCommand cmd1 = new SqlCommand ();
-                       SqlCommand cmd2 = new SqlCommand ();
-
-                       da.DeleteCommand = cmd1;
-                       Assert.AreSame (cmd1, da.DeleteCommand, "#A1");
-                       da.DeleteCommand = cmd2;
-                       Assert.AreSame (cmd2, da.DeleteCommand, "#A2");
-                       da.DeleteCommand = null;
-                       Assert.IsNull (da.DeleteCommand, "#A3");
-
-                       try {
-                               da.DeleteCommand = new OdbcCommand ();
-                               Assert.Fail ("#B1");
-                       } catch (InvalidCastException ex) {
-                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
-                               Assert.IsNull (ex.InnerException, "#B3");
-                               Assert.IsNotNull (ex.Message, "#B4");
-                       }
-               }
-
                [Test]
                public void Dispose ()
                {
@@ -419,30 +397,6 @@ namespace MonoTests.System.Data.SqlClient
                        Assert.IsNull (da.InsertCommand, "#3");
                }
 
-               [Test]
-               public void InsertCommand_IDbDataAdapter ()
-               {
-                       IDbDataAdapter da = new SqlDataAdapter ();
-                       SqlCommand cmd1 = new SqlCommand ();
-                       SqlCommand cmd2 = new SqlCommand ();
-
-                       da.InsertCommand = cmd1;
-                       Assert.AreSame (cmd1, da.InsertCommand, "#A1");
-                       da.InsertCommand = cmd2;
-                       Assert.AreSame (cmd2, da.InsertCommand, "#A2");
-                       da.InsertCommand = null;
-                       Assert.IsNull (da.InsertCommand, "#A3");
-
-                       try {
-                               da.InsertCommand = new OdbcCommand ();
-                               Assert.Fail ("#B1");
-                       } catch (InvalidCastException ex) {
-                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
-                               Assert.IsNull (ex.InnerException, "#B3");
-                               Assert.IsNotNull (ex.Message, "#B4");
-                       }
-               }
-
                [Test]
                public void SelectCommand ()
                {
@@ -458,31 +412,6 @@ namespace MonoTests.System.Data.SqlClient
                        Assert.IsNull (da.SelectCommand, "#3");
                }
 
-               [Test]
-               public void SelectCommand_IDbDataAdapter ()
-               {
-                       IDbDataAdapter da = new SqlDataAdapter ();
-                       SqlCommand cmd1 = new SqlCommand ();
-                       SqlCommand cmd2 = new SqlCommand ();
-
-                       da.SelectCommand = cmd1;
-                       Assert.AreSame (cmd1, da.SelectCommand, "#A1");
-                       da.SelectCommand = cmd2;
-                       Assert.AreSame (cmd2, da.SelectCommand, "#A2");
-                       da.SelectCommand = null;
-                       Assert.IsNull (da.SelectCommand, "#A3");
-
-                       try {
-                               da.SelectCommand = new OdbcCommand ();
-                               Assert.Fail ("#B1");
-                       } catch (InvalidCastException ex) {
-                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
-                               Assert.IsNull (ex.InnerException, "#B3");
-                               Assert.IsNotNull (ex.Message, "#B4");
-                       }
-               }
-
-#if NET_2_0
                [Test]
                public void UpdateBatchSize ()
                {
@@ -510,7 +439,6 @@ namespace MonoTests.System.Data.SqlClient
                                Assert.AreEqual ("UpdateBatchSize", ex.ParamName, "#6");
                        }
                }
-#endif
 
                [Test]
                public void UpdateCommand ()
@@ -527,6 +455,80 @@ namespace MonoTests.System.Data.SqlClient
                        Assert.IsNull (da.UpdateCommand, "#3");
                }
 
+#if !MOBILE
+               [Test]
+               public void DeleteCommand_IDbDataAdapter ()
+               {
+                       IDbDataAdapter da = new SqlDataAdapter ();
+                       SqlCommand cmd1 = new SqlCommand ();
+                       SqlCommand cmd2 = new SqlCommand ();
+                       
+                       da.DeleteCommand = cmd1;
+                       Assert.AreSame (cmd1, da.DeleteCommand, "#A1");
+                       da.DeleteCommand = cmd2;
+                       Assert.AreSame (cmd2, da.DeleteCommand, "#A2");
+                       da.DeleteCommand = null;
+                       Assert.IsNull (da.DeleteCommand, "#A3");
+                       
+                       try {
+                               da.DeleteCommand = new OdbcCommand ();
+                               Assert.Fail ("#B1");
+                       } catch (InvalidCastException ex) {
+                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+                               Assert.IsNull (ex.InnerException, "#B3");
+                               Assert.IsNotNull (ex.Message, "#B4");
+                       }
+               }
+
+               
+               [Test]
+               public void InsertCommand_IDbDataAdapter ()
+               {
+                       IDbDataAdapter da = new SqlDataAdapter ();
+                       SqlCommand cmd1 = new SqlCommand ();
+                       SqlCommand cmd2 = new SqlCommand ();
+                       
+                       da.InsertCommand = cmd1;
+                       Assert.AreSame (cmd1, da.InsertCommand, "#A1");
+                       da.InsertCommand = cmd2;
+                       Assert.AreSame (cmd2, da.InsertCommand, "#A2");
+                       da.InsertCommand = null;
+                       Assert.IsNull (da.InsertCommand, "#A3");
+                       
+                       try {
+                               da.InsertCommand = new OdbcCommand ();
+                               Assert.Fail ("#B1");
+                       } catch (InvalidCastException ex) {
+                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+                               Assert.IsNull (ex.InnerException, "#B3");
+                               Assert.IsNotNull (ex.Message, "#B4");
+                       }
+               }
+
+               [Test]
+               public void SelectCommand_IDbDataAdapter ()
+               {
+                       IDbDataAdapter da = new SqlDataAdapter ();
+                       SqlCommand cmd1 = new SqlCommand ();
+                       SqlCommand cmd2 = new SqlCommand ();
+                       
+                       da.SelectCommand = cmd1;
+                       Assert.AreSame (cmd1, da.SelectCommand, "#A1");
+                       da.SelectCommand = cmd2;
+                       Assert.AreSame (cmd2, da.SelectCommand, "#A2");
+                       da.SelectCommand = null;
+                       Assert.IsNull (da.SelectCommand, "#A3");
+                       
+                       try {
+                               da.SelectCommand = new OdbcCommand ();
+                               Assert.Fail ("#B1");
+                       } catch (InvalidCastException ex) {
+                               Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+                               Assert.IsNull (ex.InnerException, "#B3");
+                               Assert.IsNotNull (ex.Message, "#B4");
+                       }
+               }
+
                [Test]
                public void UpdateCommand_IDbDataAdapter ()
                {
@@ -550,5 +552,6 @@ namespace MonoTests.System.Data.SqlClient
                                Assert.IsNotNull (ex.Message, "#B4");
                        }
                }
+#endif
        }
 }
index f37a3e7ead0253e973062b3b06f2e4afced13997..f458464dff1b772d6d65375960549bb0d522f8e7 100644 (file)
@@ -28,7 +28,6 @@
 
 using System;
 using System.Data;
-using System.Data.OleDb ;
 using System.IO;
 using System.Collections;
 
index 26e1301417cacfee4fe6466c058bdbe6e69576df..174ebc4ee004b7b05819cfe05b4f7edbebe51256 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
 using System;
 using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
 
 namespace MonoTests.System.Data
 {
index b8011577bd39aa5fc2f01c7b9fd2afe864d48d23..2875dc0a1090f8bfa9dafb2ce0a061c0dcce8c15 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
 using System;
 using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
 
 namespace MonoTests.System.Data
 {
index c4d5718928029e6d724cae0eb110cdec8360b994..7da3dca21f0b2db64186b45234732d8366561c5c 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
 using System;
 using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
 
 namespace MonoTests.System.Data
 {
index 9c71d2aa51d432965e70fe54687b10d8410db91c..63d75f2c410a66a8f479cc1d57059168a7be79a3 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
 //\r
 using NUnit.Framework;\r
-using NUnit.Framework.SyntaxHelpers;\r
 using System;\r
 using System.Data;\r
+#if !MOBILE\r
+using NUnit.Framework.SyntaxHelpers;\r
+#endif\r
 \r
 namespace MonoTests.System.Data\r
 {\r
index 2b6bce55263094c0390abed12e76201ae6553cc6..ee5198993b39d9b3b48959df22915c3d92db0873 100644 (file)
@@ -23,7 +23,7 @@ namespace MonoTests.System.Data {
     [global::System.ComponentModel.ToolboxItem(true)]
     [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
     [global::System.Xml.Serialization.XmlRootAttribute("DataSet1")]
-    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
+//    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
     public partial class DataSet1 : global::System.Data.DataSet {
         
         private DataTable1DataTable tableDataTable1;
index abb52fd79070812d40360e7127ec7c384d9202d6..faba7c394ee003d25bca5359e53e30d20db4cf46 100644 (file)
@@ -283,7 +283,9 @@ namespace MonoTests.System.Data
                        substring = TextString.Substring (0, TextString.IndexOf(EOL));
                        TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length);
                        // This is original DataSet.WriteXmlSchema() output
-#if NET_4_0
+#if MOBILE
+                       Assert.AreEqual ("              <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
+#elif NET_4_0
                        Assert.AreEqual ("              <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
 #elif NET_2_0
                        Assert.AreEqual ("              <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
index 18711b9987d86bebdfa2aae07533c073cbdd2461..fe6701a579ede5b6c267595d56773a8fecf9c440 100644 (file)
@@ -40,7 +40,8 @@ using System.Runtime.Serialization.Formatters.Binary;
 
 namespace MonoTests_System.Data
 {
-       [TestFixture] public class DataSetTest2
+       [TestFixture]
+       public class DataSetTest2
        {
                private DataSet m_ds = null;
                private bool EventRaised = false;
@@ -3519,17 +3520,17 @@ namespace MonoTests_System.Data
                        //ds1.Load (reader, LoadOption.PreserveChanges, dt3, dt4);
                        ds1.Load (reader, LoadOption.OverwriteChanges, dt3, dt4);
 
-                       Assertion.AssertEquals ("DataSet Tables count mistmatch", ds2.Tables.Count, ds1.Tables.Count);
+                       Assert.AreEqual (ds2.Tables.Count, ds1.Tables.Count, "DataSet Tables count mistmatch");
                        int i = 0;
                        foreach (DataTable dt in ds1.Tables) {
                                DataTable dt5 = ds2.Tables[i];
-                               Assertion.AssertEquals ("Table " + dt.TableName + " row count mistmatch", dt5.Rows.Count, dt.Rows.Count);
+                               Assert.AreEqual (dt5.Rows.Count, dt.Rows.Count, "Table " + dt.TableName + " row count mistmatch");
                                int j = 0;
                                DataRow row1;
                                foreach (DataRow row in dt.Rows) {
                                        row1 = dt5.Rows[j];
                                        for (int k = 0; k < dt.Columns.Count; k++) {
-                                               Assertion.AssertEquals ("DataRow " + k + " mismatch", row1[k], row[k]);
+                                               Assert.AreEqual (row1[k], row[k], "DataRow " + k + " mismatch");
                                        }
                                        j++;
                                }
@@ -3567,17 +3568,17 @@ namespace MonoTests_System.Data
                        //ds1.Load (reader, LoadOption.PreserveChanges, dt3, dt4);
                        ds1.Load (reader, LoadOption.OverwriteChanges, dt3, dt4);
 
-                       Assertion.AssertEquals ("DataSet Tables count mistmatch", ds2.Tables.Count, ds1.Tables.Count);
+                       Assert.AreEqual (ds2.Tables.Count, ds1.Tables.Count, "DataSet Tables count mistmatch");
                        int i = 0;
                        foreach (DataTable dt in ds1.Tables) {
                                DataTable dt5 = ds2.Tables[i];
-                               Assertion.AssertEquals ("Table " + dt.TableName + " row count mistmatch", dt5.Rows.Count, dt.Rows.Count);
+                               Assert.AreEqual (dt5.Rows.Count, dt.Rows.Count, "Table " + dt.TableName + " row count mistmatch");
                                int j = 0;
                                DataRow row1;
                                foreach (DataRow row in dt.Rows) {
                                        row1 = dt5.Rows[j];
                                        for (int k = 0; k < dt.Columns.Count; k++) {
-                                               Assertion.AssertEquals ("DataRow " + k + " mismatch", row1[k], row[k]);
+                                               Assert.AreEqual (row1[k], row[k], "DataRow " + k + " mismatch");
                                        }
                                        j++;
                                }
index d1b4b0ed718391c1b73860c7492cfdf43db1e9be..d41235ef4b3f9c441d409d9d71642c36a5976658 100644 (file)
@@ -4153,7 +4153,7 @@ namespace MonoTests.System.Data
                        Assert.AreEqual (5, n, "n");
                }
 
-#if !TARGET_JVM
+#if !TARGET_JVM && !MONOTOUCH
                [Test]
                public void NFIFromBug55978 ()
                {
index 819cbcc65d1b106d88a9ba0e4a7127a4dd2887f1..2cdd5af913b61dc33046cc18a12503d5b11c9f24 100644 (file)
@@ -27,7 +27,6 @@
 using System;
 using System.Data;
 using System.Collections;
-using System.Data.Odbc;
 using System.IO;
 using System.Xml;
 using NUnit.Framework;
index 968e02d1d90292f996037725a018b77bead16e76..57b5eb30846c9f6fddbfbce275d26caa6ad3bf71 100644 (file)
@@ -46,8 +46,8 @@ namespace MonoTests.System.Data
                        string deleted = @"<DataViewSettingCollectionString><table2-1 Sort="""" RowFilter="""" RowStateFilter=""Deleted""/></DataViewSettingCollectionString>";
 
                        DataViewManager m = new DataViewManager (null);
-                       Assert (m.DataSet == null);
-                       Assert (m.DataViewSettingCollectionString == "");
+                       AssertNull (m.DataSet);
+                       AssertEquals ("", m.DataViewSettingCollectionString);
                        AssertNotNull (m.DataViewSettings);
                        DataSet ds = new DataSet ("ds");
                        m.DataSet = ds;
index 381824a7c9ca6ff1fb9ba89db99f681b0bc1028f..945b22a484c133f221f36a64228b248096e57777 100644 (file)
@@ -28,6 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOBILE
 
 using System;
 using System.CodeDom;
@@ -101,3 +102,5 @@ namespace MonoTests.System.Data
                }
        }
 }
+
+#endif
\ No newline at end of file
index ae61651797d61f819043cd6a364b0a1d80d27cc9..c47c0bd597d945847e9e61621d5398aaa9ec43d7 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
 using System;
 using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
 
 namespace MonoTests.System.Data
 {
index c5693a20c25576665e091d34cf3b6caeef245ca9..546db60bfb941b37a8bfc21cd94778fc45a2d628 100644 (file)
@@ -41,14 +41,9 @@ namespace Monotests_System.Data
                [Test]
                public void XmlLoadTest ()
                {
-                       try {
                                DataSet ds = new DataSet();
                                ds.ReadXmlSchema ("Test/System.Data/TestReadXmlSchema1.xml");
                                ds.ReadXml ("Test/System.Data/TestReadXml1.xml");
-                               ds = null;
-                       } catch {
-                               Assert.Fail ("#1 Should not throw Exception");
-                       }
                }
                
                // Test for Bug#377146
index a4597538202c90986b0df6e22c1798d487d002c4..ff587520a49b5a402e432dcce64537942c8f1fdc 100644 (file)
@@ -1,3 +1,5 @@
+#if !MOBILE
+
 using System;
 using System.Runtime.Serialization;
 using System.IO;
@@ -357,3 +359,4 @@ public abstract class ESObject : INotifyPropertyChanged
     }
 }
 
+#endif
index 04637c3015a7383f00a7fe2cd854928e307918d1..7a3834dd93c94c871a4c0cbd973d0ea053c1a6b6 100644 (file)
@@ -38,7 +38,9 @@ using System.Runtime.Serialization;
 using System.ServiceModel;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
+#if !MOBILE
 using NUnit.Framework.SyntaxHelpers;
+#endif
 
 namespace MonoTests.System.Runtime.Serialization
 {
@@ -239,7 +241,7 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (Serialize<ICollection<int>> (list), Is.EqualTo (arrayResult), "#3");
 
                        Assert.That (Serialize<IList<object>> (list),
-                                    Is.InstanceOfType (typeof (InvalidCastException)), "#4");
+                                    InstanceOf (typeof (InvalidCastException)), "#4");
 
                        Assert.That (Serialize<IList<int>> (mylist), Is.EqualTo (arrayResult), "#5");
                        Assert.That (Serialize<IList<int>> (list.AsReadOnly ()), Is.EqualTo (arrayResult), "#6");
@@ -261,7 +263,7 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (Serialize<IList<int>> (mylist), Is.EqualTo (arrayResult), "#1");
                        Assert.That (Serialize<List<int>> (mylist), Is.EqualTo (arrayResult), "#2");
                        Assert.That (Serialize<IMyList<int>> (mylist),
-                                    Is.InstanceOfType (typeof (SerializationException)), "#3");
+                                    InstanceOf (typeof (SerializationException)), "#3");
                        Assert.That (Serialize<MyList<int>> (mylist), Is.EqualTo (arrayResult), "#4");
                }
 
@@ -295,14 +297,14 @@ namespace MonoTests.System.Runtime.Serialization
                                Deserialize<CustomList<int>> (arrayResult);
                                Assert.Fail ("#5");
                        } catch (Exception ex) {
-                               Assert.That (ex, Is.InstanceOfType (typeof (SerializationException)), "#6");
+                               Assert.That (ex, InstanceOf (typeof (SerializationException)), "#6");
                        }
 
                        try {
                                Deserialize<ReadOnlyCollection<int>> (arrayResult);
                                Assert.Fail ("#7");
                        } catch (Exception ex) {
-                               Assert.That (ex, Is.InstanceOfType (typeof (SerializationException)), "#8");
+                               Assert.That (ex, InstanceOf (typeof (SerializationException)), "#8");
                        }
 
                        /*
@@ -324,9 +326,9 @@ namespace MonoTests.System.Runtime.Serialization
                        var list = new List<int> (array);
 
                        Assert.That (Serialize<int[]> (list),
-                                    Is.InstanceOfType (typeof (InvalidCastException)), "#1");
+                                    InstanceOf (typeof (InvalidCastException)), "#1");
                        Assert.That (Serialize<object[]> (array),
-                                    Is.InstanceOfType (typeof (InvalidCastException)), "#2");
+                                    InstanceOf (typeof (InvalidCastException)), "#2");
                }
 
                [Test]
@@ -412,33 +414,33 @@ namespace MonoTests.System.Runtime.Serialization
                public void TestCollectionDataContract ()
                {
                        Assert.That (Serialize<MissingAddMethod<int>> (new MissingAddMethod<int> ()),
-                                    Is.InstanceOfType (typeof (InvalidDataContractException)), "#1");
+                                    InstanceOf (typeof (InvalidDataContractException)), "#1");
                        Assert.That (Serialize<MissingEnumerable<int>> (new MissingEnumerable<int> ()),
-                                    Is.InstanceOfType (typeof (InvalidDataContractException)), "#2");
+                                    InstanceOf (typeof (InvalidDataContractException)), "#2");
 
                        var array = new[] { 1, 2, 3 };
                        var arrayResult = (string)Serialize<int[]> (array);
                        var collection = new MyDataContractCollection<int> (array);
                        
                        var result = Serialize<MyDataContractCollection<int>> (collection);
-                       Assert.That (result, Is.InstanceOfType (typeof(string)), "#3");
+                       Assert.That (result, InstanceOf (typeof(string)), "#3");
 
                        Assert.That (Serialize<MyDataContractCollection<int>> (array),
-                                    Is.InstanceOfType (typeof (SerializationException)), "#4");
+                                    InstanceOf (typeof (SerializationException)), "#4");
 
                        var derived = new MyDerivedDataContract<int> ();
                        Assert.That (Serialize<MyDataContractCollection<int>> (derived),
-                                    Is.InstanceOfType (typeof (SerializationException)), "#5");
+                                    InstanceOf (typeof (SerializationException)), "#5");
 
                        try {
                                Deserialize<MyDataContractCollection<int>> (arrayResult);
                                Assert.Fail ("#6");
                        } catch (Exception ex) {
-                               Assert.That (ex, Is.InstanceOfType (typeof(SerializationException)), "#7");
+                               Assert.That (ex, InstanceOf (typeof(SerializationException)), "#7");
                        }
                        
                        var deserialized = Deserialize<MyDataContractCollection<int>> ((string)result);
-                       Assert.That (deserialized, Is.InstanceOfType (typeof (MyDataContractCollection<int>)), "#8");
+                       Assert.That (deserialized, InstanceOf (typeof (MyDataContractCollection<int>)), "#8");
                }
 
                [Test]
@@ -446,9 +448,13 @@ namespace MonoTests.System.Runtime.Serialization
                {
                        var derived = new MyDerivedDataContract<int> ();
                        Assert.That (Serialize<MyDataContractCollection<int>> (derived),
-                                    Is.InstanceOfType (typeof (SerializationException)), "#5");
+                                    InstanceOf (typeof (SerializationException)), "#5");
                }
 
+               public static InstanceOfTypeConstraint InstanceOf (Type expectedType)
+               {
+                       return new InstanceOfTypeConstraint (expectedType);
+               }
        }
 }
 
index 274af8a33d35af2c0a85de322d30340e180395e1..57274e2d940b65e0272ca0f3d8273293ffbde80a 100644 (file)
@@ -23,6 +23,9 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
+
+#if !MOBILE
+
 using System;
 using System.IO;
 using System.Linq;
@@ -176,3 +179,5 @@ namespace MonoTests.System.Runtime.Serialization
        }
 }
 
+#endif
+
index 21dadac1d955656001713bdb84fb523956c0b49b..a581621f5427fad8c354291f5c8d60ad2c97ccae 100644 (file)
@@ -26,6 +26,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOBILE
+
 using System;
 using System.Collections.Generic;
 
@@ -409,3 +411,4 @@ namespace OtherNs
        }
 }
 
+#endif
\ No newline at end of file
index 088100a87c835402371aa6a62e2b7797f7487260..6a9b66a6485cfa4b050f788b6ced91d33a28ae9c 100644 (file)
@@ -23,6 +23,9 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
+
+#if !MOBILE
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -169,3 +172,5 @@ namespace MonoTests.System.Runtime.Serialization
                }
        }
 }
+
+#endif
index e0aed6824dc7f19cc5cde6e47b48cfe216f6769d..2e5ebe44d162b102d6b2ee5132698840317ec652 100644 (file)
@@ -32,6 +32,8 @@
 // NetDataContractSerializer. The code could be mostly common.
 //
 
+#if !MOBILE
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -783,3 +785,5 @@ namespace MonoTests.System.Runtime.Serialization
        }
 
 }
+
+#endif
index b7bf4be827bb016b3473d41d48916ba96bac1a70..690ebfe36eaacd57b29ffada790d6a6995c7aadd 100644 (file)
@@ -23,6 +23,9 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
+
+#if !MOBILE
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -359,3 +362,5 @@ namespace MonoTests.System.Runtime.Serialization
                }
        }
 }
+
+#endif
index 726cea09fa54b7ca13e76dc0e403433a59bd30ed..11d2a9535b2302d65378cc749a1540178f4f403c 100644 (file)
@@ -32,6 +32,7 @@ using System.IO;
 using System.Text;
 using System.Xml;
 using NUnit.Framework;
+using NUnit.Framework.Constraints;
 
 namespace MonoTests.System.Xml
 {
@@ -717,7 +718,7 @@ Console.WriteLine ();
                        int [] arr = new int [] {0, 2, 0, 6, 8, 10,};
                        w.WriteArray ("", "el", "", arr, 2, 3);
                        w.Close ();
-                       Assert.AreEqual (array_int32, ms.ToArray ());
+                       Assert.That (ms.ToArray (), new CollectionEquivalentConstraint (array_int32));
                }
 
                // make sure that 0 is not written in shortened format.
index 3cee19a44e85e1f4ec5ab2ed7712d0e609efe58a..d22c6ffdb62d480ff8b6024bf4e73d4203d55784 100644 (file)
@@ -26,6 +26,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOBILE
+
 using System;
 using System.IO;
 using System.Text;
@@ -95,3 +97,5 @@ Content-Type: application/xop+xml;charset=utf-8;type=""sTaRt""
                }
        }
 }
+
+#endif
\ No newline at end of file
index a8a077f2cd903f63386d54ffb3cdea2ec4a0aece..7b68f1dfbe558a23987796e76ea9d191a7ed79cc 100644 (file)
@@ -16,6 +16,7 @@
 using System;
 using System.Transactions;
 using NUnit.Framework;
+using NUnit.Framework.Constraints;
 
 namespace MonoTests.System.Transactions {
 
@@ -763,9 +764,9 @@ namespace MonoTests.System.Transactions {
                        Assert.IsTrue(called, "TransactionCompleted event handler not called!");
                        Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
                        Assert.IsNotNull(ex, "Exception not thrown");
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException is null");
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+                       Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
                }
 
                [Test]
@@ -803,12 +804,12 @@ namespace MonoTests.System.Transactions {
                        Assert.IsNotNull(ex, "Exception not thrown");
 #if MS_EXCEPTIONS_BEHAVIOR
                        // MS.NET will relay the exception thrown by RM instead of wrapping it on a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex, "Invalid exception thrown");
+                       InstanceOf(typeof(NotSupportedException), ex, "Invalid exception thrown");
 #else
                        // Mono wrapps the exception into a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid type of inner exception thrown");
+                       Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
 #endif
                }
 
@@ -846,7 +847,7 @@ namespace MonoTests.System.Transactions {
                        Assert.IsFalse(called, "TransactionCompleted event handler _was_ called!?!?!");
                        Assert.IsNotNull(ex, "Exception not thrown");
                        // MS.NET will relay the exception thrown by RM instead of wrapping it on a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex, "Invalid exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(NotSupportedException)), "Invalid exception thrown");
                }
 
                [Test]
@@ -881,9 +882,9 @@ namespace MonoTests.System.Transactions {
 
                        Assert.IsTrue(called, "TransactionCompleted event handler not called!");
                        Assert.IsNotNull(ex, "Exception not thrown");
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException is null");
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+                       Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
                        Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
                }
                #endregion
@@ -1032,7 +1033,7 @@ namespace MonoTests.System.Transactions {
                        Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM");
 #else
                        // Mono wrapps the exception into a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
                        Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
 #endif
@@ -1083,7 +1084,7 @@ namespace MonoTests.System.Transactions {
                        Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM \n Ex: {0}", ex);
 #else
                        // Mono wrapps the exception into a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
                        Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
 #endif
@@ -1174,9 +1175,9 @@ namespace MonoTests.System.Transactions {
 
                        Assert.IsTrue(called, "TransactionCompleted event handler not called!");
                        Assert.IsNotNull(ex, "Exception not thrown");
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException is null");
-                       Assert.IsInstanceOfType(typeof(InvalidOperationException), ex.InnerException, "Invalid inner exception thrown");
+                       Assert.That (ex.InnerException, InstanceOf( typeof(InvalidOperationException)), "Invalid inner exception thrown");
                        Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
                }
 
@@ -1219,9 +1220,9 @@ namespace MonoTests.System.Transactions {
 
                        Assert.IsTrue(called, "TransactionCompleted event handler not called!");
                        Assert.IsNotNull(ex, "Exception not thrown");
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException is null");
-                       Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+                       Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
                        Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
                }
 
@@ -1274,7 +1275,7 @@ namespace MonoTests.System.Transactions {
                        Assert.AreEqual(rm2.ThrowThisException, ex, "Exception does not come from the expected RM");
 #else
                        // Mono wrapps the exception into a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
                        Assert.AreEqual(rm2.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex.InnerException);
 #endif
@@ -1329,7 +1330,7 @@ namespace MonoTests.System.Transactions {
                        Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM");
 #else
                        // Mono wrapps the exception into a TransactionAbortedException.
-                       Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+                       Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
                        Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
                        Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
 #endif
@@ -1340,6 +1341,10 @@ namespace MonoTests.System.Transactions {
 
                #endregion
 
+               public static InstanceOfTypeConstraint InstanceOf (Type expectedType)
+               {
+                       return new InstanceOfTypeConstraint (expectedType);
+               }
        }
 }
 
index 25d812ed90c08b58ee84bd8e90520c7b5330a595..80925e27f5231a8c64ae261bc11f52978f44553c 100644 (file)
@@ -17,6 +17,7 @@ namespace MonoTests.System.Transactions
        [TestFixture]
        public class TransactionScopeTest
        {
+
                [Test]
                public void TransactionScopeCommit ()
                {
index 1d962112dc96a54cb0f7b0ae2ed6e1b17cefdc99..ec88cb908333d5b28e392632b7523ead8b567cdf 100644 (file)
@@ -7,6 +7,8 @@
 // Copyright (C) 2007 Novell, Inc.
 //
 
+#if !MOBILE
+
 using NUnit.Framework;
 
 using System;
@@ -20,7 +22,6 @@ namespace MonoTests.System.Web.Services.Description
        [TestFixture]
        public class ServiceDescriptionImporterTest
        {
-#if NET_2_0
                CodeNamespace GenerateCodeFromWsdl (ServiceDescription sd)
                {
                        ServiceDescriptionImporter imp =
@@ -118,6 +119,7 @@ Console.WriteLine ("***" + cd.Name);
                        }
                        Assert.IsTrue (verified, "verified");
                }
-#endif
        }
 }
+
+#endif
index 236a22af78fa3db3b3f1a7705c552cfee71acd27..3fdd90de50774f945c1ea173f928d3421c4e07e8 100644 (file)
@@ -9,6 +9,8 @@
 // Copyright (C) 2006 Novell, Inc.
 //
 
+
+#if !MOBILE
 using NUnit.Framework;
 
 using System;
@@ -478,3 +480,5 @@ namespace MonoTests.System.Web.Services.Description
 #endif
        }
 }
+
+#endif
index b8fe3c3661b553c7f793a3462d2a82685881992c..9a4746fee0b987923e88935008947661a3f3c831 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright (C) 2006 Novell, Inc.
 //
 
-#if NET_2_0
+#if !MOBILE
 
 using NUnit.Framework;
 
index 2278340f43ba4f604fc6cf8d48e2b65b52b27769..7703aedb811a4faf0e0c766190b902a9d2e0810a 100644 (file)
@@ -6,7 +6,7 @@
 //
 // Copyright (C) 2007 Novell, Inc.
 //
-#if NET_2_0
+#if !MOBILE
 using NUnit.Framework;
 
 using System;
index 59b7bcb1e6137bc046276582cde095c47748ca8e..6952a996261cc766112cfec1b99f419cff86c278 100644 (file)
@@ -6,7 +6,7 @@
 //
 // Copyright (C) 2007 Novell, Inc.
 //
-#if NET_2_0
+#if !MOBILE
 using NUnit.Framework;
 
 using System;
index a9d94e837668f233108f7f55526a14bf2ea9a244..0820ad6030ad30869e50a4d7e0ca402b761236bf 100644 (file)
@@ -12,7 +12,6 @@
 using NUnit.Framework;
 using System;
 using System.Web.Services;
-using System.EnterpriseServices;
 
 namespace MonoTests.System.Web.Services {
 
index bb8071452a0d5b2352b6fdf8ae8301515941a39f..82429d61f578a1238d3a4991f107f5a1eafbdaba 100644 (file)
@@ -7,10 +7,10 @@
 // Copyright (C) 2007 Novell, Inc.
 //
 
+#if !MOBILE
 using NUnit.Framework;
 using System;
 using System.Web.Services;
-using System.EnterpriseServices;
 
 namespace MonoTests.System.Web.Services 
 {
@@ -24,3 +24,5 @@ namespace MonoTests.System.Web.Services
                }
        }
 }
+
+#endif
\ No newline at end of file