public void Build_Sucessful() { XsdReader reader = new XsdReader(); ConfigurationFile.Xsd = new Element(); if (reader.ProcessSchema(FileLocation.XsdFile)) { NewRelic.AgentConfiguration.MainForm.XsdPath = FileLocation.XsdFile; } XmlWalker xm = new XmlWalker(); xm.ProcessXml(FileLocation.ConfigFile); NewRelic.AgentConfiguration.MainForm.ConfigPath = FileLocation.ConfigFile;; ConfigMerge cm = new ConfigMerge(); FlowLayoutPanel panel = new FlowLayoutPanel(); ToolTip mainFormToolTip = new ToolTip(); UIBuilder ui = new UIBuilder(panel, mainFormToolTip); ui.Build(true); Assert.IsTrue(panel.Controls.Count > 0, panel.Controls.Count.ToString()); }
internal void ImportXml(XElement root, string uri) { if (root.Name.LocalName == "schema" && root.Name.NamespaceName == XsdReader.XsdNamespace) { XsdReader reader = new XsdReader(this, root, uri); this.RegisterReader(uri, reader); reader.CollectImportedFiles(); } else if (root.Name.LocalName == "definitions" && root.Name.NamespaceName == WsdlReader.WsdlNamespace) { WsdlReader reader = new WsdlReader(this, root, uri); this.RegisterReader(uri, reader); reader.CollectImportedFiles(); } else { this.AddError("Unknown XML data.", uri, GetLinePositionSpan(root)); return; } }
public void Merge_Success() { XsdReader reader = new XsdReader(); ConfigurationFile.Xsd = new Element(); if (reader.ProcessSchema(FileLocation.XsdFile)) { NewRelic.AgentConfiguration.MainForm.XsdPath = FileLocation.XsdFile; } XmlWalker xm = new XmlWalker(); xm.ProcessXml(FileLocation.ConfigFile); NewRelic.AgentConfiguration.MainForm.ConfigPath = FileLocation.ConfigFile;; ConfigMerge cm = new ConfigMerge(); //How to test this? It just does it with the defaults //I could refactor to make it take the config and xsd so I could replace them with elements. Assert.IsTrue(true); }
public void ProcessSchema_EmptyPath() { XsdReader reader = new XsdReader(); Assert.IsFalse(reader.ProcessSchema("")); }
public void ProcessSchema_Success() { XsdReader reader = new XsdReader(); Assert.IsTrue(reader.ProcessSchema(FileLocation.XsdFile)); }