From dd4cc7ca66274220f04135db2bb93a0224b74ba0 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 1 Mar 2013 15:30:59 +0100 Subject: Tests update for mobile profile --- .../Test/Mono.Math/ArithmeticBigTest.cs | 16 +++---- .../Test/Mono.Math/SearchGeneratorTest.cs | 2 +- .../AuthenticodeDeformatterTest.cs | 2 +- .../Mono.Security.Authenticode/PrivateKeyTest.cs | 8 +++- .../SoftwarePublisherCertificateTest.cs | 18 ++++--- .../Test/Mono.Security/StrongNameTest.cs | 9 +++- .../Test/System.Net.Http/HttpClientTest.cs | 6 +-- .../Test/System.Net.Http/StreamContentTest.cs | 2 +- .../Test/System.Net.Http/StringContentTest.cs | 3 +- .../Test/System.Xml.Schema/XmlSchemaTests.cs | 1 + .../SchemaImporterExtensionCollectionTests.cs | 2 +- .../SchemaImporterExtensionTests.cs | 2 +- .../SoapSchemaExporterTests.cs | 4 ++ .../XmlCodeExporterTests.cs | 4 ++ .../XmlSchemaExporterTests.cs | 4 +- .../XmlSchemaImporterTests.cs | 55 ++++++++++++---------- .../System.Xml.Serialization/XmlSerializerTests.cs | 4 +- .../Test/System.Xml/XmlDocumentEventTests.cs | 5 -- .../Test/System.Xml/XmlSecureResolverCas.cs | 4 ++ .../Test/System.Xml/XmlSecureResolverTests.cs | 3 ++ .../Test/System.Xml/XmlUrlResolverTests.cs | 8 ++-- .../Test/System.Xml/XmlWriterSettingsTests.cs | 1 + .../Test/System.Xml.Linq/XAttributeTest.cs | 8 ++-- .../Test/System.Xml.Linq/XElementTest.cs | 8 ++-- .../Test/System.Xml.Schema/ExtensionsTest.cs | 4 ++ 25 files changed, 108 insertions(+), 75 deletions(-) (limited to 'mcs') diff --git a/mcs/class/Mono.Security/Test/Mono.Math/ArithmeticBigTest.cs b/mcs/class/Mono.Security/Test/Mono.Math/ArithmeticBigTest.cs index 94ff296ced5..ac05640807f 100644 --- a/mcs/class/Mono.Security/Test/Mono.Math/ArithmeticBigTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Math/ArithmeticBigTest.cs @@ -179,48 +179,48 @@ namespace MonoTests.Mono.Math.Arithmetic.Big { [Test] public void AgtB () { - Assertion.Assert(A > B); + Assert.IsTrue(A > B); } [Test] public void ANotLtB () { - Assertion.Assert(!(A < B)); + Assert.IsTrue(!(A < B)); } [Test] public void BNotGtA () { - Assertion.Assert(!(B > A)); + Assert.IsTrue(!(B > A)); } [Test] public void AltB () { - Assertion.Assert(B < A); + Assert.IsTrue(B < A); } [Test] public void AeqA () { - Assertion.Assert(A == A); + Assert.AreEqual(A, A); } [Test] public void BeqB () { - Assertion.Assert(B == B); + Assert.AreEqual(B, B); } [Test] public void AneqB () { - Assertion.Assert(A != B); + Assert.AreNotEqual(A, B); } [Test] public void BneqA () { - Assertion.Assert(B != A); + Assert.AreNotEqual(B, A); } #endregion diff --git a/mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs b/mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs index 189dbd9d0df..80434f9983c 100644 --- a/mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs @@ -62,7 +62,7 @@ namespace MonoTests.Mono.Math { for (int i = 0; i < 5; i++) { ContextData ctx = new ContextData (128, (uint)r.Next (int.MinValue, int.MaxValue)); BigInteger p = GenerateNewPrime (128, ctx); - Assertion.Assert (p.TestBit (1)); + Assert.IsTrue (p.TestBit (1)); uint d = ctx.testData; for (uint j = 128 - 2; d > 0; j--, d >>= 1) Assertion.AssertEquals ((d&1) == 1, p.TestBit (j)); diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs index d15087aef00..0a1fd9f3d1a 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs @@ -678,7 +678,7 @@ namespace MonoTests.Mono.Security.Authenticode { private string WriteFile () { - string filename = "helloworld_signed.exe"; + string filename = Path.Combine (Path.GetTempPath (), "helloworld_signed.exe"); try { if (File.Exists (filename)) { File.Delete (filename); diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs index ee8145cff6b..0f529496e11 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs @@ -96,7 +96,13 @@ public class PrivateKeyTest : Assertion { Assert (msg, a); } - private const string testfile = "test.pvk"; + string testfile; + + [TestFixtureSetUp] + public void FixtureSetup () + { + testfile = Path.Combine (Path.GetTempPath (), "test.pvk"); + } [TearDown] public void TearDown () diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs index 6e6adce2b86..11136a48904 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs @@ -381,7 +381,13 @@ namespace MonoTests.Mono.Security.Authenticode { 0x77, 0xEF, 0xEC, 0x17, 0x92, 0xC7, 0xD6, 0xCD, 0xE1, 0x2A, 0x2E, 0xE7, 0xF3, 0xED, 0x7F, 0x66, 0x86, 0x31, 0x00 }; - private const string testfile = "test.spc"; + string testfile; + + [TestFixtureSetUp] + public void FixtureSetup () + { + testfile = Path.Combine (Path.GetTempPath (), "test.spc"); + } [TearDown] public void TearDown () @@ -397,11 +403,11 @@ namespace MonoTests.Mono.Security.Authenticode { if (unicode) { data = Encoding.Unicode.GetBytes (s); } else if (pem) { - string b64pem = "-----BEGIN PKCS7-----\n" + s + "\n-----END PKCS7-----"; - data = Encoding.ASCII.GetBytes (b64pem); - using (FileStream fs = File.Create ("bad.pem")) { - fs.Write (data, 0, data.Length); - } + //string b64pem = "-----BEGIN PKCS7-----\n" + s + "\n-----END PKCS7-----"; + //data = Encoding.ASCII.GetBytes (b64pem); + //using (FileStream fs = File.Create ("bad.pem")) { + // fs.Write (data, 0, data.Length); + //} } else { data = Encoding.ASCII.GetBytes (s); } diff --git a/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs b/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs index 43bc7a5fbb9..05e013cd4aa 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs @@ -127,8 +127,8 @@ namespace MonoTests.Mono.Security { AssertEquals ("key.PublicKeyToken", sn1.PublicKeyToken, sn2.PublicKeyToken); } - private const string Signed = "hellosigned.exe"; - private const string Delay = "hellodelay.exe"; + string Signed; + string Delay; private StrongName sn; private static byte[] signedData = { 0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, @@ -787,11 +787,16 @@ namespace MonoTests.Mono.Security { [SetUp] public void SetUp () { + Signed = Path.Combine (Path.GetTempPath (), "hellosigned.exe"); + Delay = Path.Combine (Path.GetTempPath (), "hellodelay.exe"); + sn = new StrongName (key); // write hellosigned.exe to disk FileStream fs = File.OpenWrite (Signed); fs.Write (signedData, 0, signedData.Length); fs.Close (); + + // write hellodelay.exe to disk fs = File.OpenWrite (Delay); fs.Write (delayData, 0, delayData.Length); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index c5a8dc430ad..6651be4a64f 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -525,7 +525,7 @@ namespace MonoTests.System.Net.Http client.SendAsync (request, HttpCompletionOption.ResponseContentRead).Wait (WaitTimeout); Assert.Fail ("#2"); } catch (AggregateException e) { - Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#3"); + Assert.IsTrue (e.InnerException is HttpRequestException, "#3"); } } finally { @@ -699,7 +699,7 @@ namespace MonoTests.System.Net.Http client.GetByteArrayAsync (LocalServer).Wait (WaitTimeout); Assert.Fail ("#1"); } catch (AggregateException e) { - Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2"); + Assert.IsTrue (e.InnerException is HttpRequestException , "#2"); } } finally { listener.Close (); @@ -726,7 +726,7 @@ namespace MonoTests.System.Net.Http client.GetStringAsync (LocalServer).Wait (WaitTimeout); Assert.Fail ("#1"); } catch (AggregateException e) { - Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2"); + Assert.IsTrue (e.InnerException is HttpRequestException, "#2"); } } finally { listener.Abort (); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs index b4a541afab2..edd4b839c16 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs @@ -331,7 +331,7 @@ namespace MonoTests.System.Net.Http Assert.IsTrue (sc.LoadIntoBufferAsync (50).Wait (200)); Assert.Fail ("#1"); } catch (AggregateException e) { - Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2"); + Assert.IsTrue (e.InnerException is HttpRequestException, "#2"); } } diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/StringContentTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/StringContentTest.cs index 51a077176b8..f031fc3ea8e 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/StringContentTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/StringContentTest.cs @@ -61,9 +61,10 @@ namespace MonoTests.System.Net.Http var s = new StringContent ("aaa", null, "multipart/*"); Assert.AreEqual ("Content-Type: multipart/*; charset=utf-8\r\n", s.Headers.ToString ()); - +#if !MOBILE s = new StringContent ("aaa", Encoding.GetEncoding (852), "multipart/*"); Assert.AreEqual ("Content-Type: multipart/*; charset=ibm852\r\n", s.Headers.ToString ()); +#endif } [Test] diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs index 0e91387a4be..779c8bd1e1e 100644 --- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs @@ -173,6 +173,7 @@ namespace MonoTests.System.Xml } [Test] + [Category ("MobileNotWorking")] public void TestSimpleMutualImport () { XmlReader r = new XmlTextReader ("Test/XmlFiles/xsd/inter-inc-1.xsd"); diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollectionTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollectionTests.cs index 718e62c1fff..20b0d5dbaf8 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollectionTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollectionTests.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 +#if !MOBILE using System; using System.CodeDom; diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionTests.cs index 5b8d9de6dcc..7311fbb27e8 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionTests.cs @@ -28,7 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 +#if !MOBILE using System; using System.CodeDom; diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/SoapSchemaExporterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/SoapSchemaExporterTests.cs index 9f0e0191135..b1c7597c150 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/SoapSchemaExporterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/SoapSchemaExporterTests.cs @@ -7,6 +7,8 @@ // (C) 2005 Novell // +#if !MOBILE + using System; using System.Collections; using System.Globalization; @@ -1159,3 +1161,5 @@ namespace MonoTests.System.XmlSerialization } } } + +#endif \ No newline at end of file diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs index 25a1ecf74bf..91f0ed1d282 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs @@ -8,6 +8,8 @@ // (C) 2006 Novell // +#if !MOBILE + using System; using System.CodeDom; using System.CodeDom.Compiler; @@ -1304,3 +1306,5 @@ namespace MonoTests.System.XmlSerialization } } } + +#endif diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaExporterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaExporterTests.cs index f8713258a0f..fc55852869d 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaExporterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaExporterTests.cs @@ -1783,11 +1783,9 @@ namespace MonoTests.System.XmlSerialization [Test] #if NET_2_0 [Category ("NotWorking")] // support for XmlSchemaProvider is not implemented -#else - [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn #endif public void ExportXmlSerializable_SchemaProvider1 () { - XmlSchemas schemas = schemas = Export (typeof (PrimitiveSchemaProvider)); + XmlSchemas schemas = Export (typeof (PrimitiveSchemaProvider)); Assert.AreEqual (1, schemas.Count, "#1"); StringWriter sw = new StringWriter (); diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs index 80958667639..fe4838cb2e9 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs @@ -39,8 +39,9 @@ using System.IO; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; +#if !MOBILE using Microsoft.CSharp; - +#endif using NUnit.Framework; using MonoTests.System.Xml.TestClasses; @@ -891,6 +892,8 @@ namespace MonoTests.System.Xml.Serialization Assert.AreEqual ("UInt16", map.TypeName, "#6"); } +#if !MOBILE + [Test] public void ImportTypeMapping_EnumSimpleContent () { @@ -1075,30 +1078,6 @@ namespace MonoTests.System.Xml.Serialization return null; } - private static XmlSchemas ExportType (Type type) - { - XmlReflectionImporter ri = new XmlReflectionImporter ("NS" + type.Name); - XmlSchemas schemas = new XmlSchemas (); - XmlSchemaExporter sx = new XmlSchemaExporter (schemas); - XmlTypeMapping tm = ri.ImportTypeMapping (type); - sx.ExportTypeMapping (tm); - return schemas; - } - - private static ArrayList GetXmlQualifiedNames (XmlSchemas schemas) - { - ArrayList qnames = new ArrayList (); - - foreach (XmlSchema schema in schemas) { - if (!schema.IsCompiled) schema.Compile (null); - foreach (XmlSchemaObject ob in schema.Items) - if (ob is XmlSchemaElement) - qnames.Add (((XmlSchemaElement) ob).QualifiedName); - } - - return qnames; - } - [Test] [ExpectedException (typeof (InvalidOperationException))] public void ImportTypeMappingNonExistent () @@ -1238,5 +1217,31 @@ namespace MonoTests.System.Xml.Serialization xss.Add (XmlSchema.Read (new XmlTextReader (new StringReader (xsd)), null)); return new XmlSchemaImporter (xss); } + +#endif + + private static ArrayList GetXmlQualifiedNames (XmlSchemas schemas) + { + ArrayList qnames = new ArrayList (); + + foreach (XmlSchema schema in schemas) { + if (!schema.IsCompiled) schema.Compile (null); + foreach (XmlSchemaObject ob in schema.Items) + if (ob is XmlSchemaElement) + qnames.Add (((XmlSchemaElement) ob).QualifiedName); + } + + return qnames; + } + + private static XmlSchemas ExportType (Type type) + { + XmlReflectionImporter ri = new XmlReflectionImporter ("NS" + type.Name); + XmlSchemas schemas = new XmlSchemas (); + XmlSchemaExporter sx = new XmlSchemaExporter (schemas); + XmlTypeMapping tm = ri.ImportTypeMapping (type); + sx.ExportTypeMapping (tm); + return schemas; + } } } diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs index a7f00ab1e24..ed63ede99fa 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs @@ -2187,8 +2187,7 @@ namespace MonoTests.System.XmlSerialization ser.Deserialize (new XmlTextReader (xml, XmlNodeType.Document, null)); } -#if NET_2_0 -#if !TARGET_JVM +#if !TARGET_JVM && !MOBILE [Test] public void GenerateSerializerGenerics () { @@ -2266,7 +2265,6 @@ namespace MonoTests.System.XmlSerialization Assert.AreEqual (TestEnumWithNulls.bb, w.nenum.Value); Assert.AreEqual (t, w.ndate.Value); } -#endif [Test] public void SerializeBase64Binary() diff --git a/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs index 4df96725fbb..657d672e5bc 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs @@ -18,11 +18,6 @@ namespace MonoTests.System.Xml [TestFixture] public class XmlDocumentEventTests { - public static void Main () - { - new XmlDocumentEventTests ().InsertingOrder (); - } - private StringBuilder eventLogBuilder = new StringBuilder (); private XmlDocument GetEventDocument () diff --git a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverCas.cs b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverCas.cs index d8035e4d010..52de90d1414 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverCas.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverCas.cs @@ -27,6 +27,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !MOBILE + using NUnit.Framework; using System; @@ -82,3 +84,5 @@ namespace MonoCasTests.System.Xml { } } } + +#endif \ No newline at end of file diff --git a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs index 0603a694d42..c97407de984 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs @@ -8,6 +8,8 @@ // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) // +#if !MOBILE + using System; using System.Collections; using System.IO; @@ -132,3 +134,4 @@ namespace MonoTestsXml } } +#endif diff --git a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs index 17e94fc1567..59752547bc0 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs @@ -104,19 +104,17 @@ namespace MonoTests.System.Xml #if NET_4_5 [Test] - [Category("Async")] public void TestAsync () { var loc = Assembly.GetExecutingAssembly ().Location; Uri resolved = resolver.ResolveUri (null, loc); Assert.AreEqual ("file", resolved.Scheme); var task = resolver.GetEntityAsync (resolved, null, typeof (Stream)); - Assert.That (task.Wait (3000)); - Assert.IsInstanceOfType (typeof (Stream), task.Result); + Assert.IsTrue (task.Wait (3000)); + Assert.IsTrue (task.Result is Stream); } [Test] - [Category("Async")] public void TestAsyncError () { var loc = Assembly.GetExecutingAssembly ().Location; @@ -129,7 +127,7 @@ namespace MonoTests.System.Xml } catch (Exception ex) { if (ex is AggregateException) ex = ((AggregateException) ex).InnerException; - Assert.IsInstanceOfType (typeof (XmlException), ex); + Assert.IsTrue (ex is XmlException); } } #endif diff --git a/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs index 6ade78b4461..bd5cb6af26f 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs @@ -47,6 +47,7 @@ namespace MonoTests.System.Xml } [Test] + [Category ("MobileNotWorking")] public void EncodingTest () { // For Stream it makes sense diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XAttributeTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XAttributeTest.cs index 15bad621e9c..7d1e8302b68 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XAttributeTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XAttributeTest.cs @@ -451,7 +451,7 @@ namespace MonoTests.System.Xml.Linq Assert.IsNotNull ((double?) new XAttribute (m), "m:double?:null"); Assert.AreEqual (double.NegativeInfinity, ((double?) new XAttribute (m)).Value, "m:double?:value"); Assert.IsNotNull ((double?) new XAttribute (n), "n:double?:null"); - Assert.IsNaN (((double?) new XAttribute (n)).Value, "n:double?:value"); + Assert.AreEqual (double.NaN, ((double?) new XAttribute (n)).Value, "n:double?:value"); Assert.IsNotNull ((float?) new XAttribute (a), "a:float?:null"); Assert.AreEqual (7f, ((float?) new XAttribute (a)).Value, "a:float?:value"); Assert.IsNotNull ((float?) new XAttribute (b), "b:float?:null"); @@ -473,7 +473,7 @@ namespace MonoTests.System.Xml.Linq Assert.IsNotNull ((float?) new XAttribute (m), "m:float?:null"); Assert.AreEqual (float.NegativeInfinity, ((float?) new XAttribute (m)).Value, "m:float?:value"); Assert.IsNotNull ((float?) new XAttribute (n), "n:float?:null"); - Assert.IsNaN (((float?) new XAttribute (n)).Value, "n:float?:value"); + Assert.AreEqual (float.NaN, ((float?) new XAttribute (n)).Value, "n:float?:value"); AssertThrows (() => { Guid? z = (Guid?) new XAttribute (a); }, "a:Guid?"); AssertThrows (() => { Guid? z = (Guid?) new XAttribute (b); }, "b:Guid?"); AssertThrows (() => { Guid? z = (Guid?) new XAttribute (c); }, "c:Guid?"); @@ -629,7 +629,7 @@ namespace MonoTests.System.Xml.Linq Assert.AreEqual (double.PositiveInfinity, (double) new XAttribute (i), "i:double"); Assert.AreEqual (double.NegativeInfinity, (double) new XAttribute (M), "M:double"); Assert.AreEqual (double.NegativeInfinity, (double) new XAttribute (m), "m:double"); - Assert.IsNaN (((double) new XAttribute (n)), "n:double"); + Assert.AreEqual (double.NaN, ((double) new XAttribute (n)), "n:double"); Assert.AreEqual (7f, (float) new XAttribute (a), "a:float"); Assert.AreEqual (42f, (float) new XAttribute (b), "b:float"); Assert.AreEqual (123f, (float) new XAttribute (c), "c:float"); @@ -640,7 +640,7 @@ namespace MonoTests.System.Xml.Linq Assert.AreEqual (float.PositiveInfinity, (float) new XAttribute (i), "i:float"); Assert.AreEqual (float.NegativeInfinity, (float) new XAttribute (M), "M:float"); Assert.AreEqual (float.NegativeInfinity, (float) new XAttribute (m), "m:float"); - Assert.IsNaN (((float) new XAttribute (n)), "n:float"); + Assert.AreEqual (float.NaN, ((float) new XAttribute (n)), "n:float"); AssertThrows (() => { Guid z = (Guid) new XAttribute (a); }, "a:Guid"); AssertThrows (() => { Guid z = (Guid) new XAttribute (b); }, "b:Guid"); AssertThrows (() => { Guid z = (Guid) new XAttribute (c); }, "c:Guid"); diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs index 59a38543164..5a5f255094c 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs @@ -907,7 +907,7 @@ namespace MonoTests.System.Xml.Linq Assert.IsNotNull ((double?) new XElement (m), "m:double?:null"); Assert.AreEqual (double.NegativeInfinity, ((double?) new XElement (m)).Value, "m:double?:value"); Assert.IsNotNull ((double?) new XElement (n), "n:double?:null"); - Assert.IsNaN (((double?) new XElement (n)).Value, "n:double?:value"); + Assert.AreEqual (double.NaN, ((double?) new XElement (n)).Value, "n:double?:value"); Assert.IsNotNull ((float?) new XElement (a), "a:float?:null"); Assert.AreEqual (7f, ((float?) new XElement (a)).Value, "a:float?:value"); Assert.IsNotNull ((float?) new XElement (b), "b:float?:null"); @@ -929,7 +929,7 @@ namespace MonoTests.System.Xml.Linq Assert.IsNotNull ((float?) new XElement (m), "m:float?:null"); Assert.AreEqual (float.NegativeInfinity, ((float?) new XElement (m)).Value, "m:float?:value"); Assert.IsNotNull ((float?) new XElement (n), "n:float?:null"); - Assert.IsNaN (((float?) new XElement (n)).Value, "n:float?:value"); + Assert.AreEqual (float.NaN, ((float?) new XElement (n)).Value, "n:float?:value"); AssertThrows (() => { Guid? z = (Guid?) new XElement (a); }, "a:Guid?"); AssertThrows (() => { Guid? z = (Guid?) new XElement (b); }, "b:Guid?"); AssertThrows (() => { Guid? z = (Guid?) new XElement (c); }, "c:Guid?"); @@ -1085,7 +1085,7 @@ namespace MonoTests.System.Xml.Linq Assert.AreEqual (double.PositiveInfinity, (double) new XElement (i), "i:double"); Assert.AreEqual (double.NegativeInfinity, (double) new XElement (M), "M:double"); Assert.AreEqual (double.NegativeInfinity, (double) new XElement (m), "m:double"); - Assert.IsNaN (((double) new XElement (n)), "n:double"); + Assert.AreEqual (double.NaN, ((double) new XElement (n)), "n:double"); Assert.AreEqual (7f, (float) new XElement (a), "a:float"); Assert.AreEqual (42f, (float) new XElement (b), "b:float"); Assert.AreEqual (13f, (float) new XElement (c), "c:float"); @@ -1096,7 +1096,7 @@ namespace MonoTests.System.Xml.Linq Assert.AreEqual (float.PositiveInfinity, (float) new XElement (i), "i:float"); Assert.AreEqual (float.NegativeInfinity, (float) new XElement (M), "M:float"); Assert.AreEqual (float.NegativeInfinity, (float) new XElement (m), "m:float"); - Assert.IsNaN (((float) new XElement (n)), "n:float"); + Assert.AreEqual (float.NaN, ((float) new XElement (n)), "n:float"); AssertThrows (() => { Guid z = (Guid) new XElement (a); }, "a:Guid"); AssertThrows (() => { Guid z = (Guid) new XElement (b); }, "b:Guid"); AssertThrows (() => { Guid z = (Guid) new XElement (c); }, "c:Guid"); diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs index 2ed1b5dedb6..da577e644ef 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs @@ -9,6 +9,8 @@ // (C) Stefan Prutianu // +#if !MOBILE + using NUnit.Framework; using System; using System.Xml; @@ -467,3 +469,5 @@ namespace MonoTests.System.Xml.Schema } } + +#endif \ No newline at end of file -- cgit v1.2.3