public void NamespaceSelectedButNotModifiedShouldNotBeSavedInXmlEditorOptions() { panel.SelectedXmlSchemaFileAssociationListItemIndex = 0; panel.SetMethodToCallWhenSchemaNamespacePrefixChanged(schemasEditor.SchemaNamespacePrefixChanged); schemasEditor.XmlSchemaFileAssociationFileExtensionSelectionChanged(); schemasEditor.SaveOptions(); Assert.IsTrue(String.IsNullOrEmpty(properties.Get("ext.bar", String.Empty))); }
public void WhenSelectedSchemaNamespacePrefixModifiedSchemasEditorSchemaNamespacePrefixChangedMethodCalled() { XmlSchemaFileAssociationListItem xmlSchemaAssociation = new XmlSchemaFileAssociationListItem(".xml", "namespace-uri", "x"); panel.AddXmlSchemaFileAssociationListItem(xmlSchemaAssociation); panel.SelectedXmlSchemaFileAssociationListItemIndex = 0; bool methodCalled = false; panel.SetMethodToCallWhenSchemaNamespacePrefixChanged(delegate() { methodCalled = true; }); panel.SetSelectedSchemaNamespacePrefix("test"); Assert.IsTrue(methodCalled); }