public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { Properties p = new Properties(); p.Set("NamespacesDataGridView.PrefixColumn.Width", 10); queryControl.SetMemento(p); prefixColumnWidthAfterLoad = queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width; queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width = 40; p = queryControl.CreateMemento(); prefixColumnWidthAfterSave = p.Get <int>("NamespacesDataGridView.PrefixColumn.Width", 0); } }
public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { Properties p = new Properties(); expectedNamespaces = new List <XmlNamespace>(); expectedNamespaces.Add(new XmlNamespace("f", "http://foo.com")); expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com")); List <string> namespaces = new List <string>(); foreach (XmlNamespace xmlNamespace in expectedNamespaces) { namespaces.Add(xmlNamespace.ToString()); } p.SetList("Namespaces", namespaces); queryControl.SetMemento(p); actualNamespaces = queryControl.GetNamespaces(); } }
public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { Properties p = new Properties(); p.Set("XPathResultsListView.MatchColumn.Width", 10); p.Set("XPathResultsListView.LineColumn.Width", 20); queryControl.SetMemento(p); matchColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[0].Width; lineColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[1].Width; queryControl.XPathResultsListView.Columns[0].Width = 40; queryControl.XPathResultsListView.Columns[1].Width = 50; p = queryControl.CreateMemento(); matchColumnWidthAfterSave = p.Get <int>("XPathResultsListView.MatchColumn.Width", 0); lineColumnWidthAfterSave = p.Get <int>("XPathResultsListView.LineColumn.Width", 0); } }
public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { expectedNamespaces = new List <XmlNamespace>(); expectedNamespaces.Add(new XmlNamespace("f", "http://foo.com")); expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com")); foreach (XmlNamespace xmlNamespace in expectedNamespaces) { queryControl.AddNamespace(xmlNamespace.Prefix, xmlNamespace.Uri); } // Blank prefix and uris should be ignored. queryControl.AddNamespace(String.Empty, String.Empty); // Null cell values ignored. queryControl.NamespacesDataGridView.Rows.Add(new object[] { null, null }); Properties p = queryControl.CreateMemento(); actualNamespaces = p.Get("Namespaces", new string[0]); } }
public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { expectedNamespaces = new List <XmlNamespace>(); expectedNamespaces.Add(new XmlNamespace("w", "http://www.wix.com")); expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com")); foreach (XmlNamespace ns in expectedNamespaces) { queryControl.AddNamespace(ns.Prefix, ns.Uri); } namespacesAddedToGrid = new List <XmlNamespace>(); for (int i = 0; i < queryControl.NamespacesDataGridView.Rows.Count - 1; ++i) { DataGridViewRow row = queryControl.NamespacesDataGridView.Rows[i]; namespacesAddedToGrid.Add(new XmlNamespace((string)row.Cells[0].Value, (string)row.Cells[1].Value)); } namespaces = queryControl.GetNamespaces(); } }
public void SetUpFixture() { using (XPathQueryControl queryControl = new XPathQueryControl()) { Properties p = new Properties(); p.Set("XPathQuery.LastQuery", "//w:Wix"); expectedXPathsAfterLoad = new string[] { "//w:Fragment", "//w:Dialog" }; p.SetList("XPathQuery.History", expectedXPathsAfterLoad); queryControl.SetMemento(p); comboBoxTextAfterLoad = queryControl.XPathComboBox.Text; comboBoxItemsAfterLoad = GetComboBoxItems(queryControl.XPathComboBox); queryControl.XPathComboBox.Text = "*"; queryControl.XPathComboBox.Items.Clear(); queryControl.XPathComboBox.Items.Add("xs:schema"); expectedXPathsAfterSave = GetComboBoxItems(queryControl.XPathComboBox); p = queryControl.CreateMemento(); xpathQueryAfterSave = p.Get("XPathQuery.LastQuery", String.Empty); xpathsAfterSave = p.GetList <string>("XPathQuery.History").ToArray(); } }