2 // WebReferenceOptionsTest.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2006 Novell, Inc.
12 using NUnit.Framework;
16 using System.Web.Services.Description;
18 using System.Xml.Schema;
19 using System.Xml.Serialization;
20 using System.Collections;
22 namespace MonoTests.System.Web.Services.Description
25 public class WebReferenceOptionsTest
27 string xml1 = "<webReferenceOptions xmlns='http://microsoft.com/webReference/' />";
29 <webReferenceOptions xmlns='http://microsoft.com/webReference/'>
30 <codeGenerationOptions>properties newAsync</codeGenerationOptions>
32 <verbose>false</verbose>
33 </webReferenceOptions>
36 <webReferenceOptions xmlns='http://microsoft.com/webReference/'>
39 </webReferenceOptions>";
42 [Category ("NotDotNet")] // why on earth does it allow invalid xml?
49 Assert.Fail ("xml3 is invalid.");
50 } catch (XmlSchemaValidationException) {
54 void Validate (string xml)
56 XmlReaderSettings s = new XmlReaderSettings ();
57 s.ValidationType = ValidationType.Schema;
58 s.Schemas.Add (WebReferenceOptions.Schema);
59 XmlReader r = XmlReader.Create (new StringReader (xml), s);
71 Assert.Fail ("xml3 is invalid.");
72 } catch (InvalidOperationException) {
76 void Read (string xml)
78 XmlReader r = XmlReader.Create (new StringReader (xml));
79 WebReferenceOptions.Read (r, null);