public void RegisteredSchemaAssociationMatchedByFileExtensionIsCaseInsensitive()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".abc", "namespace-uri", "prefix");

            properties.Set("ext.abc", ".abc|namespace-uri|prefix");
            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(".ABC"));
        }
        public void RegisteredSchemaAssociationMatchedByFullFileNameInsteadOfExtension()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".abc", "namespace-uri", "prefix");

            properties.Set("ext.abc", ".abc|namespace-uri|prefix");
            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(@"d:\projects\a.abc"));
        }
        public void RegisteredSchemaAssociationStoredInProperties()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(".abc", "namespace-uri", "prefix");

            associations.SetSchemaFileAssociation(schemaAssociation);
            Assert.AreEqual(".abc|namespace-uri|prefix", properties.Get("ext.abc", String.Empty));
        }
Esempio n. 4
0
        public void MatchIfFileExtensionAndNamespaceUriAndPrefixMatch()
        {
            XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
            XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");

            Assert.IsTrue(lhs.Equals(rhs));
        }
Esempio n. 5
0
        public void DoNotMatchNamespacesDifferent()
        {
            XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
            XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "different-namespaceUri", "prefix");

            Assert.IsFalse(lhs.Equals(rhs));
        }
Esempio n. 6
0
        public void FileExtensionAndNamespaceUriConvertedFromString()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation("ext", "namespace-uri");
            XmlSchemaFileAssociation schemaAssociation         = XmlSchemaFileAssociation.ConvertFromString("ext|namespace-uri|");

            Assert.AreEqual(expectedSchemaAssociation, schemaAssociation);
        }
Esempio n. 7
0
        public void FileExtensionConvertedFromString()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation("ext", String.Empty);
            XmlSchemaFileAssociation schemaAssociation         = XmlSchemaFileAssociation.ConvertFromString("ext||");

            Assert.AreEqual(expectedSchemaAssociation, schemaAssociation);
        }
        public void RegisteredSchemaAssociationReturnedByXmlEditorOptions()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".abc", "namespace-uri", "prefix");

            properties.Set("ext.abc", ".abc|namespace-uri|prefix");
            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(".abc"));
        }
        public void NamespacePrefixModifiesXmlSchemaFileAssociation()
        {
            panel.SetSelectedSchemaNamespacePrefix("modified-prefix");
            schemasEditor.SchemaNamespacePrefixChanged();
            schemasEditor.SaveOptions();
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".bar", "http://bar", "modified-prefix");

            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(".bar"));
        }
        public void SchemaAssociationWithFileExtensionIsNotEmpty()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(".fileExt", String.Empty, String.Empty);

            Assert.IsFalse(schemaAssociation.IsEmpty);
        }
        public void SchemaAssociationWithBlankFileExtensionAndNamespaceUriAndNamespacePrefixIsEmpty()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(String.Empty, String.Empty, String.Empty);

            Assert.IsTrue(schemaAssociation.IsEmpty);
        }
        public void SchemaAssociationWithPrefixConvertedToString()
        {
            XmlSchemaFileAssociation schemaAssocation = new XmlSchemaFileAssociation(".xml", "namespaceUri", "prefix");

            Assert.AreEqual(".xml|namespaceUri|prefix", schemaAssocation.ToString());
        }
Esempio n. 13
0
        public void EmpyStringConverted()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(String.Empty, String.Empty);

            Assert.AreEqual(expectedSchemaAssociation, XmlSchemaFileAssociation.ConvertFromString(String.Empty));
        }
Esempio n. 14
0
        public void DoesNotMatchAStringObject()
        {
            XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");

            Assert.IsFalse(lhs.Equals("String"));
        }
        public void SchemaAssociationWithNamespaceUriIsNotEmpty()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(String.Empty, "namespace-uri", String.Empty);

            Assert.IsFalse(schemaAssociation.IsEmpty);
        }
Esempio n. 16
0
        public void FindSchemaAssociationByFileExtensionIsCaseInsensitive()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xsl", "http://example.com/xsl", "xs");

            Assert.AreEqual(expectedSchemaAssociation, schemaAssociations.Find(".XSL"));
        }
Esempio n. 17
0
        public void SecondSchemaAssociationIsForXslFiles()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xsl", "http://example.com/xsl", "xs");

            Assert.AreEqual(expectedSchemaAssociation, schemaAssociations[1]);
        }
Esempio n. 18
0
        public void FirstSchemaAssociationIsForXmlFiles()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xml", "http://example.com", String.Empty);

            Assert.AreEqual(expectedSchemaAssociation, schemaAssociations[0]);
        }
        public void FileExtensionIsLowerCased()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(".XML", String.Empty);

            Assert.AreEqual(".xml", schemaAssociation.FileExtension);
        }
        public void DefaultXmlExtensionRevertedToIfNoFileExtensionSavedInXmlEditorOptionsProperties()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xml", "http://example.com", "e");

            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(".xml"));
        }
        public void SchemaAssociationWithNamespacePrefixIsNotEmpty()
        {
            XmlSchemaFileAssociation schemaAssociation = new XmlSchemaFileAssociation(String.Empty, String.Empty, "prefix");

            Assert.IsFalse(schemaAssociation.IsEmpty);
        }
        public void UnknownFileExtensionReturnsEmptySchemaAssociation()
        {
            XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(String.Empty, String.Empty, String.Empty);

            Assert.AreEqual(expectedSchemaAssociation, associations.GetSchemaFileAssociation(".unknown"));
        }