コード例 #1
0
		public void FromXmlMissingSchemaAssociation()
		{
			string propertiesXml = "<SerializedNode/>";
			XmlTextReader reader = new XmlTextReader(new StringReader(propertiesXml));
			XmlSchemaAssociation schema = new MonoDevelop.XmlEditor.XmlSchemaAssociation(String.Empty);
			Assert.IsNull(schema.ReadFrom(reader));
		}		
コード例 #2
0
		public void FromXml()
		{
			XmlSchemaAssociation expectedSchema = new XmlSchemaAssociation(".xml", "http://mono-project.com");
			expectedSchema.WriteTo(writer);

			string propertiesXml = "<SerializedNode>" + xml.ToString() + "</SerializedNode>";
			XmlTextReader reader = new XmlTextReader(new StringReader(propertiesXml));
			XmlSchemaAssociation schema = new MonoDevelop.XmlEditor.XmlSchemaAssociation(String.Empty);
			schema = (XmlSchemaAssociation)schema.ReadFrom(reader);
			
			Assert.AreEqual(expectedSchema.Extension, schema.Extension);
			Assert.AreEqual(expectedSchema.NamespacePrefix, schema.NamespacePrefix);
			Assert.AreEqual(expectedSchema.NamespaceUri, schema.NamespaceUri);
		}