Exemplo n.º 1
0
        public void SimpleFileName()
        {
            string fileName    = @"C:\temp\foo.xml";
            string expectedUri = "file:///C:/temp/foo.xml";

            Assert.AreEqual(expectedUri, XmlSchemaCompletionProvider.GetUri(fileName));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates two schemas, one which references the other via an
        /// xs:include.  Both schemas will exist in the same folder.
        /// </summary>
        /// <param name="mainSchema">The main schema's xml.</param>
        /// <param name="includedSchema">The included schema's xml.</param>
        internal static XmlSchemaCompletionProvider CreateSchemaCompletionDataObject(string mainSchema, string includedSchema)
        {
            if (!Directory.Exists(schemaPath))
            {
                Directory.CreateDirectory(schemaPath);
            }

            CreateSchema(Path.Combine(schemaPath, mainSchemaFileName), mainSchema);
            CreateSchema(Path.Combine(schemaPath, includedSchemaFileName), includedSchema);

            // Parse schema.
            string schemaFileName = Path.Combine(schemaPath, mainSchemaFileName);
            string baseUri        = XmlSchemaCompletionProvider.GetUri(schemaFileName);

            return(new XmlSchemaCompletionProvider(baseUri, schemaFileName));
        }
Exemplo n.º 3
0
 public void EmptyString()
 {
     Assert.AreEqual(String.Empty, XmlSchemaCompletionProvider.GetUri(String.Empty));
 }
Exemplo n.º 4
0
 public void NullFileName()
 {
     Assert.AreEqual(String.Empty, XmlSchemaCompletionProvider.GetUri(null));
 }