Exemplo n.º 1
0
        public void GetSchemasForFooNamespaceReturnedSchemasContainDuplicateSchemas()
        {
            XmlSchemaCompletionCollection matchedSchemas = schemas.GetSchemas("foo");

            string[] expectedFileNames = new string[] { "foo.xsd", "duplicate-foo.xsd" };

            Assert.AreEqual(expectedFileNames, XmlSchemaCompletionCollectionFileNames.GetFileNames(matchedSchemas));
        }
        public void OneSchemaWithFileName()
        {
            XmlSchemaCompletion schema = new XmlSchemaCompletion();

            schema.FileName = FileName.Create("a.xsd");
            schemas.Add(schema);

            string[] expectedFileNames = new string[] { "a.xsd" };
            Assert.AreEqual(expectedFileNames, XmlSchemaCompletionCollectionFileNames.GetFileNames(schemas));
        }
Exemplo n.º 3
0
        public void GetSchemasForElementPathReturnsDuplicateFooSchemasWhenFooNamespaceUsedInPath()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("root", "foo"));

            XmlSchemaCompletionCollection foundSchemas = schemas.GetSchemas(path, null);

            string[] expectedFileNames = new string[] { "foo.xsd", "duplicate-foo.xsd" };
            Assert.AreEqual(expectedFileNames, XmlSchemaCompletionCollectionFileNames.GetFileNames(foundSchemas));
        }
        public void TwoSchemasWithFileName()
        {
            XmlSchemaCompletion schema = new XmlSchemaCompletion();

            schema.FileName = "a.xsd";
            schemas.Add(schema);

            schema          = new XmlSchemaCompletion();
            schema.FileName = "b.xsd";
            schemas.Add(schema);

            string[] expectedFileNames = new string[] { "a.xsd", "b.xsd" };
            Assert.AreEqual(expectedFileNames, XmlSchemaCompletionCollectionFileNames.GetFileNames(schemas));
        }
Exemplo n.º 5
0
        public void GetSchemasForElementPathReturnsDefaultSchemaWhenNoNamespaceUsedInPathButHasDefaultSchema()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("root", String.Empty));

            XmlSchemaCompletion defaultSchema = new XmlSchemaCompletion();

            defaultSchema.FileName = "default.xsd";

            XmlSchemaCompletionCollection foundSchemas = schemas.GetSchemas(path, defaultSchema);

            string[] expectedFileNames = new string[] { "default.xsd" };
            Assert.AreEqual(expectedFileNames, XmlSchemaCompletionCollectionFileNames.GetFileNames(foundSchemas));
        }
 public void NoItemsInSchemaCollection()
 {
     Assert.AreEqual(0, XmlSchemaCompletionCollectionFileNames.GetFileNames(schemas).Length);
 }