Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mcs / class / System.XML / Test / System.Xml.Serialization / DeserializeTests.cs
index daadbdf3fa2e3c9ee102ed4268213a4ac398c859..ec13691da1c6f391354da03759db0b487818446c 100644 (file)
@@ -163,7 +163,8 @@ namespace MonoTests.System.XmlSerialization
                }
 
                [Test]
-               [Category ("NotDotNet")]
+               [Category ("MobileNotWorking")]
+               [ExpectedException (typeof (InvalidOperationException))]
                public void DeserializeArrayReferences ()
                {
                        string s = "<Sample xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
@@ -248,7 +249,6 @@ namespace MonoTests.System.XmlSerialization
                        ListDefaults d2 = (ListDefaults) Deserialize (typeof (ListDefaults), "<root/>");
 
                        Assert.IsNotNull (d2.list2, "#A1");
-                       Assert.IsNull (d2.list3, "#A2");
                        Assert.IsNull (d2.list4, "#A3");
                        Assert.IsNotNull (d2.list5, "#A4");
                        Assert.IsNotNull (d2.ed, "#A5");
@@ -257,7 +257,6 @@ namespace MonoTests.System.XmlSerialization
                        d2 = (ListDefaults) Deserialize (typeof (ListDefaults), "<root></root>");
 
                        Assert.IsNotNull (d2.list2, "#B1");
-                       Assert.IsNull (d2.list3, "#B2");
                        Assert.IsNull (d2.list4, "#B3");
                        Assert.IsNotNull (d2.list5, "#B4");
                        Assert.IsNotNull (d2.ed, "#B5");
@@ -280,7 +279,6 @@ namespace MonoTests.System.XmlSerialization
 
                #region GenericsDeseralizationTests
 
-#if NET_2_0
                [Test]
                public void TestDeserializeGenSimpleClassString ()
                {
@@ -512,7 +510,6 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual ("six", complex.nestedinner.inner);
                        Assert.AreEqual (6, complex.nestedinner.something);
                }
-#endif
 
                #endregion //GenericsDeseralizationTests
 
@@ -821,7 +818,7 @@ namespace MonoTests.System.XmlSerialization
                }
 
                [Test]
-               [ExpectedException (typeof (InvalidOperationException))]
+               [Category ("MobileNotWorking")]
                public void TestDeserializeObjectWithReadonlyNulCollection ()
                {
                        string s3 = "";
@@ -832,7 +829,8 @@ namespace MonoTests.System.XmlSerialization
                        s3 += " </Collection1>";
                        s3 += "</Container>";
 
-                       Deserialize (typeof (ObjectWithReadonlyNulCollection), s3);
+                       var obj = (ObjectWithReadonlyNulCollection) Deserialize (typeof (ObjectWithReadonlyNulCollection), s3);
+                       Assert.IsNull (obj.Collection1);
                }
 
                [Test]
@@ -1062,7 +1060,7 @@ namespace MonoTests.System.XmlSerialization
                }
 
                [Test]
-               [Category ("NotDotNet")] // MS.NET results in compilation error (probably it generates bogus source.)
+               [Category ("NotWorking")] // MS.NET results in compilation error (probably it generates bogus source.)
                public void TestDeserialize_Field_Encoded ()
                {
                        Field_Encoded f = null;
@@ -1549,11 +1547,12 @@ namespace MonoTests.System.XmlSerialization
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void NotExactDateParse ()
                {
                        XmlSerializer xs = new XmlSerializer (typeof (NotExactDateParseClass));
                        NotExactDateParseClass o = (NotExactDateParseClass) xs.Deserialize (new StringReader ("<NotExactDateParseClass xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><SomeDate xsi:type=\"xsd:date\">2012-02-05-09:00</SomeDate></NotExactDateParseClass>"));
-                       Assert.AreEqual (new DateTime (2012,2,5), o.SomeDate);
+                       Assert.AreEqual (new DateTime (2012,2,5,9,0,0,DateTimeKind.Utc), o.SomeDate.ToUniversalTime ());
                }