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)); }
public void MatchIfFileExtensionAndNamespaceUriAndPrefixMatch() { XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix"); XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix"); Assert.IsTrue(lhs.Equals(rhs)); }
public void DoNotMatchNamespacesDifferent() { XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix"); XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "different-namespaceUri", "prefix"); Assert.IsFalse(lhs.Equals(rhs)); }
public void FileExtensionAndNamespaceUriConvertedFromString() { XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation("ext", "namespace-uri"); XmlSchemaFileAssociation schemaAssociation = XmlSchemaFileAssociation.ConvertFromString("ext|namespace-uri|"); Assert.AreEqual(expectedSchemaAssociation, schemaAssociation); }
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()); }
public void EmpyStringConverted() { XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(String.Empty, String.Empty); Assert.AreEqual(expectedSchemaAssociation, XmlSchemaFileAssociation.ConvertFromString(String.Empty)); }
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); }
public void FindSchemaAssociationByFileExtensionIsCaseInsensitive() { XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xsl", "http://example.com/xsl", "xs"); Assert.AreEqual(expectedSchemaAssociation, schemaAssociations.Find(".XSL")); }
public void SecondSchemaAssociationIsForXslFiles() { XmlSchemaFileAssociation expectedSchemaAssociation = new XmlSchemaFileAssociation(".xsl", "http://example.com/xsl", "xs"); Assert.AreEqual(expectedSchemaAssociation, schemaAssociations[1]); }
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")); }