Merge pull request #1266 from esdrubal/datetimenewformat
[mono.git] / mcs / class / System.Data / Test / System.Data / BinarySerializationTest.cs
index 5ffa21511db5686fafe7f9b714a45633eabd2bd8..efbe64a1a4a2b29ce9fbd436d8e7f5ebb9782260 100644 (file)
@@ -1,16 +1,37 @@
+#if NET_2_0
+
 using System;
 using System.Data;
+using System.Data.Common;
+using System.Globalization;
+using System.IO;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters;
 using System.Runtime.Serialization.Formatters.Binary;
-using System.IO;
-using System.Data.Common;
+using System.Threading;
+
 using NUnit.Framework;
 
+namespace MonoTests.System.Data
+{
 [TestFixture]
 public class BinarySerializationTest
 {
-#if NET_2_0
+       private CultureInfo originalCulture;
+
+       [SetUp]
+       public void SetUp ()
+       {
+               originalCulture = Thread.CurrentThread.CurrentCulture;
+               Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
+       }
+
+       [TearDown]
+       public void TearDown ()
+       {
+               Thread.CurrentThread.CurrentCulture = originalCulture;
+       }
+
        [Test]
        public void RemotingFormatDataTableTest ()
        {
@@ -113,9 +134,6 @@ public class BinarySerializationTest
                dt.Rows[1].RejectChanges();
        }
        [Test]
-#if TARGET_JVM
-       [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
        public void DataTableSerializationTest2 ()
        {
                //Serialize Table
@@ -255,9 +273,6 @@ public class BinarySerializationTest
                        
        }
        [Test]
-#if TARGET_JVM
-       [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
        public void Test_With_Null_Values2 ()
        {
                //Serialize Table
@@ -435,9 +450,6 @@ public class BinarySerializationTest
                
        }
        [Test]
-#if TARGET_JVM
-       [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
        public void DataSetSerializationTest2 ()
        {
                DataSet ds = new DataSet ();
@@ -634,9 +646,6 @@ public class BinarySerializationTest
                        Assert.AreEqual (ds.Relations [i].RelationName, ds.Relations [i].RelationName, "#9 Relation : {0} differs", ds.Relations [i]);
        }
        [Test]
-#if TARGET_JVM
-       [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
        public void Constraint_Relations_Test2 ()
        {
                //Serialize DataSet
@@ -741,5 +750,7 @@ public class BinarySerializationTest
                for (int i = 0; i < ds.Relations.Count; i++)
                        Assert.AreEqual (ds.Relations [i].RelationName, ds.Relations [i].RelationName, "#9 Relation : {0} differs", ds.Relations [i]);
        }
+}
+
 #endif
 }