public void CreateAddElementeDialog() { AddXmlNodeDialog dialog = (AddXmlNodeDialog)treeViewContainer.CallCreateAddElementDialog(new string[0]); Panel bottomPanel = (Panel)dialog.Controls["bottomPanel"]; Label customNameTextBoxLabel = (Label)bottomPanel.Controls["customNameTextBoxLabel"]; Assert.AreEqual(StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.Title}"), dialog.Text); Assert.AreEqual(StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.CustomElementLabel}"), customNameTextBoxLabel.Text); }
public void RightToLeftConversion() { try { PropertyService.Set("CoreProperties.UILanguage", RightToLeftConverter.RightToLeftLanguages[0]); using (AddXmlNodeDialog dialog = new AddXmlNodeDialog()) { Assert.AreEqual(RightToLeft.Yes, dialog.RightToLeft); } } finally { PropertyService.Set("CoreProperties.UILanguage", Thread.CurrentThread.CurrentUICulture.Name); } }
public void RightToLeftConversion() { try { RightToLeftConverter.IsRightToLeft = true; using (AddXmlNodeDialog dialog = new AddXmlNodeDialog()) { Assert.AreEqual(RightToLeft.Yes, dialog.RightToLeft); } } finally { RightToLeftConverter.IsRightToLeft = false; } }
public void NoListBoxShownWhenNoNames() { using (AddXmlNodeDialog dialog = new AddXmlNodeDialog(new string[0])) { Size expectedClientSize = this.bottomPanel.Size; Size expectedMinSize = dialog.Size; Panel bottomPanel = (Panel)dialog.Controls["bottomPanel"]; Assert.IsFalse(dialog.Controls.ContainsKey("namesListBox")); Assert.AreEqual(DockStyle.Fill, bottomPanel.Dock); Assert.AreEqual(expectedClientSize, dialog.ClientSize); Assert.AreEqual(expectedMinSize, dialog.MinimumSize); } }