//[Ignore("FLAKY - sometimes fails in tc continuous build.")] public void GeckoBox_KeyboardInputAfterInitialValueTest() { IWritingSystemDefinition ws = WritingSystemDefinition.Parse("fr"); IWeSayTextBox textBox = new GeckoBox(ws, "ControlUnderTest"); Assert.IsNotNull(textBox); Assert.AreSame(ws, textBox.WritingSystem); _window.Controls.Add((GeckoBox)textBox); _window.Show(); ControlTester t = new ControlTester("ControlUnderTest", _window); textBox.Text = "Test"; KeyboardController keyboardController = new KeyboardController(t); Application.DoEvents(); keyboardController.Press(Key.HOME); Application.DoEvents(); keyboardController.Press("V"); keyboardController.Press("a"); keyboardController.Press("l"); keyboardController.Press("u"); keyboardController.Press("e"); keyboardController.Press(" "); Application.DoEvents(); Assert.AreEqual("Value Test", textBox.Text); keyboardController.Dispose(); }
public void TestMethod() { Assert.IsNull(fCircleChart.Base); fCircleChart.Base = fBase; Assert.AreEqual(fBase, fCircleChart.Base); Assert.IsNotNull(fCircleChart.Model); var offset = fCircleChart.Model.GetOffsets(); Assert.IsNotNull(fCircleChart.Options); Assert.IsNull(fCircleChart.RootPerson); Assert.AreEqual(CircleChartType.Ancestors, fCircleChart.ChartType); fCircleChart.ChartType = CircleChartType.Descendants; Assert.AreEqual(CircleChartType.Descendants, fCircleChart.ChartType); Assert.AreEqual(1.0f, fCircleChart.Zoom); fForm.Show(); var ctl = new ControlTester("fCircleChart", fForm); Keyboard.UseOn(ctl); Keyboard.Click(Key.PAGE_UP); Keyboard.Click(Key.PAGE_DOWN); Keyboard.Click(Key.HOME); Keyboard.Click(Key.END); fForm.Close(); }
public void GivenMessageWindowWithRowSelected_WhenCtrlCPressed_ThenCopiesContentToClipboard() { // Given using (var form = new Form()) using (new ClipboardConfig()) using (MessageWindow messageWindow = ShowMessageWindow(null)) { form.Controls.Add(messageWindow); form.Show(); messageWindow.AddMessage(Level.Warn, new DateTime(), "message"); messageWindow.Refresh(); var dataGridViewControl = new ControlTester("messagesDataGridView"); var dataGridView = (DataGridView)dataGridViewControl.TheObject; dataGridView.Rows[0].Selected = true; const Keys keyData = Keys.Control | Keys.C; // When dataGridViewControl.FireEvent("KeyDown", new KeyEventArgs(keyData)); // Then IDataObject actualDataObject = ClipboardProvider.Clipboard.GetDataObject(); Assert.IsTrue(actualDataObject != null && actualDataObject.GetDataPresent(DataFormats.Text)); var actualContent = (string)actualDataObject.GetData(DataFormats.Text); Assert.AreEqual("WARN\tmessage\t00:00:00", actualContent); } }
/// ------------------------------------------------------------------------------------ private static void ClickPeopleTab() { var peopleTabTester = new ControlTester("PeopleViewTab", "ProjectWindow"); peopleTabTester.Click(); Assert.IsTrue((bool)peopleTabTester["Selected"]); }
/// ------------------------------------------------------------------------------------ private static void ClickSessionTab() { var sessionTabTester = new ControlTester("SessionsViewTab", "ProjectWindow"); sessionTabTester.Click(); Assert.IsTrue((bool)sessionTabTester["Selected"]); }
public void GeckoBox_KeyboardInputWhenReadOnlyTest() { IWritingSystemDefinition ws = WritingSystemDefinition.Parse("fr"); IWeSayTextBox textBox = new GeckoBox(ws, "ControlUnderTest"); textBox.ReadOnly = true; Assert.IsNotNull(textBox); Assert.AreSame(ws, textBox.WritingSystem); _window.Controls.Add((GeckoBox)textBox); _window.Show(); ControlTester t = new ControlTester("ControlUnderTest", _window); textBox.Text = "Value"; KeyboardController keyboardController = new KeyboardController(t); Application.DoEvents(); keyboardController.Press(Key.END); Application.DoEvents(); keyboardController.Press(" "); keyboardController.Press("T"); keyboardController.Press("e"); keyboardController.Press("s"); keyboardController.Press("t"); Application.DoEvents(); Assert.AreEqual("Value", textBox.Text); keyboardController.Dispose(); }
private void ClickStarOfLexemeForm() { ControlTester t = new ControlTester(GetNameOfLexicalFormAnnotationControl(), _window); t.Click(); GetEditControl(Field.FieldNames.EntryLexicalForm.ToString()); }
public static void CircleChartWin_Tests(CustomWindowTest formTest, Form frm, string stage) { Assert.IsInstanceOf(typeof(CircleChartWin), frm, stage); CircleChartWin ccWin = frm as CircleChartWin; IBaseWindow curBase = ccWin.Base; Assert.IsNotNull(curBase); ccWin.UpdateSettings(); Assert.IsFalse(ccWin.AllowFilter()); Assert.IsFalse(ccWin.AllowQuickSearch()); Assert.IsTrue(ccWin.AllowPrint()); // forced update ccWin.Refresh(); Assert.IsFalse(ccWin.NavCanBackward()); ccWin.NavPrev(); Assert.IsFalse(ccWin.NavCanForward()); ccWin.NavNext(); var ctl = new ControlTester("fCircleChart", frm); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Add)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Subtract)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Left)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Back)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Right)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.D0 | Keys.Control)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Up)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Down)); ctl.FireEvent("DoubleClick", new EventArgs()); ctl.Properties.Refresh(); ctl.FireEvent("DoubleClick", new EventArgs()); // empty methods Assert.IsNotNull(ccWin.FindAll("")); ccWin.QuickSearch(); ccWin.SelectByRec(null); ccWin.SetFilter(); formTest.ModalFormHandler = SaveFileJPG_Handler; ClickToolStripButton("tbImageSave", ccWin); // FIXME exception! //ModalFormHandler = SaveFileEMF_Handler; //ClickToolStripButton("tbImageSave", ccWin); formTest.ModalFormHandler = SaveFileSVG_Handler; ClickToolStripButton("tbImageSave", ccWin); KeyDownForm(frm.Name, Keys.Escape); frm.Dispose(); }
public void OpenViewForData_SelectDifferentDefaultViewAndClickOkInOpenedDialog_ReturnTrueViewAddedToViewHostAndDefaultViewTypesUpdated() { // Setup TestView view = null; var mocks = new MockRepository(); var dialogParent = mocks.Stub <IWin32Window>(); var viewHost = mocks.StrictMock <IViewHost>(); viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); viewHost.Expect(vm => vm.AddDocumentView(Arg <TestView> .Is.NotNull, Arg <string> .Is.Anything, Arg <string> .Is.Null, Arg <FontFamily> .Is.Null)) .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); mocks.ReplayAll(); var data = new object(); var viewInfos = new ViewInfo[] { new ViewInfo <object, TestViewDerivative>(), new ViewInfo <object, TestView>() }; using (var documentViewController = new DocumentViewController(viewHost, viewInfos, dialogParent)) { documentViewController.DefaultViewTypes[typeof(object)] = typeof(TestViewDerivative); DialogBoxHandler = (name, wnd) => { var buttonOk = new ControlTester("buttonOk"); var listBox = new ListBoxTester("listBox"); var checkBox = new CheckBoxTester("checkBoxDefault"); listBox.SetSelected(0, true); checkBox.Check(); buttonOk.Click(); }; // Call bool result = documentViewController.OpenViewForData(data, true); // Assert Assert.IsTrue(result); Assert.AreEqual(data, view.Data); Assert.IsEmpty(view.Text); Assert.IsTrue(documentViewController.DefaultViewTypes.ContainsKey(typeof(object))); Assert.AreEqual(documentViewController.DefaultViewTypes[typeof(object)], typeof(TestView)); } mocks.VerifyAll(); }
public void TestAddItem() { try { int j = 0; String value = ""; IWritingSystemDefinition ws = WritingSystemDefinition.Parse("fr"); var comboBox = new GeckoComboBox(); comboBox.WritingSystem = ws; comboBox.Name = "ControlUnderTest"; Assert.IsNotNull(comboBox); Assert.AreSame(ws, comboBox.WritingSystem); String volvo = "Volvo"; String saab = "Saab"; String toyota = "Toyota"; comboBox.AddItem(volvo); comboBox.AddItem(saab); comboBox.AddItem(toyota); comboBox.ListCompleted(); Application.DoEvents(); _window.Controls.Add((GeckoComboBox)comboBox); _window.Show(); ControlTester t = new ControlTester("ControlUnderTest", _window); KeyboardController keyboardController = new KeyboardController(t); Application.DoEvents(); j = comboBox.Length; keyboardController.Press("{DOWN}"); Application.DoEvents(); keyboardController.Release("{DOWN}"); Application.DoEvents(); value = (String)comboBox.SelectedItem; Assert.AreEqual(3, j); Assert.AreEqual("Saab", value); keyboardController.Press("{DOWN}"); Application.DoEvents(); keyboardController.Release("{DOWN}"); Application.DoEvents(); value = (String)comboBox.SelectedItem; Application.DoEvents(); Application.DoEvents(); Assert.AreEqual(3, j); Assert.AreEqual("Toyota", value); } catch (Exception) { // Team city sometimes throws exception on this test // Rather than remove a test that usually works, I am // putting this in to allow it to pass when timing problems // occur. } }
public KeyboardControllerTest() { textBoxForm = new TextBoxTestForm(); textBoxForm.Show(); textBoxTester = new ControlTester("myTextBox"); Assert.Equal("default", textBoxTester.Text); keyboardController = new KeyboardController(textBoxTester); }
public KeyboardControllerTest() { textBoxForm = new TextBoxTestForm(); textBoxForm.Show(); textBoxTester = new ControlTester("myTextBox"); Assert.Equal("default", textBoxTester.Text); keyboardController = new KeyboardController(textBoxTester); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Click on each tab on the session or people screen. /// </summary> /// ------------------------------------------------------------------------------------ private static void WalkThroughComponentEditorTabs(string screenName) { var screenTester = new ControlTester(screenName, "ProjectWindow"); var tabCtrl = screenTester["SelectedComponentEditorsTabControl"] as TabControl; for (int i = 0; i < tabCtrl.TabCount; i++) { tabCtrl.SelectTab(i); } }
/// <summary> /// For backwards compatibility; will be deprecated in the future. /// </summary> public static void AssertVisibility(ControlTester tester, bool expectedVisibility) { if (expectedVisibility) { WebAssert.Visible(tester); } else { WebAssert.NotVisible(tester); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Select each component file on the session and people screen. /// </summary> /// ------------------------------------------------------------------------------------ private static void WalkThroughComponentFiles(string componentGridName, string screenName) { var gridTester = new ControlTester(componentGridName, "ProjectWindow"); var grid = gridTester["Grid"] as DataGridView; foreach (DataGridViewRow row in grid.Rows) { grid.CurrentCell = grid[0, row.Index]; Application.DoEvents(); WalkThroughComponentEditorTabs(screenName); } }
public void CheckControls() { AssertControlExists("projectPathLabel"); AssertControlExists("projectBaseTextBox"); AssertControlExists("groupBox1"); AssertControlExists("closeButton"); ControlTester tester = new ControlTester(Controls["groupBox1"]); tester.AssertControlExists("configComboBox"); tester.AssertControlExists("editConfigsButton"); tester.AssertControlExists("projectTabControl"); }
public void OpenViewForData_ClickOkInOpenedDialog_ReturnTrueAndViewAddedToViewHost() { // Setup TestView view = null; var mocks = new MockRepository(); var dialogParent = mocks.Stub <IWin32Window>(); var viewHost = mocks.StrictMock <IViewHost>(); viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); viewHost.Expect(vm => vm.AddDocumentView(Arg <TestView> .Is.NotNull, Arg <string> .Is.Anything, Arg <string> .Is.Null, Arg <FontFamily> .Is.Null)) .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); mocks.ReplayAll(); var data = new object(); var viewInfos = new ViewInfo[] { new ViewInfo <object, TestViewDerivative>(), new ViewInfo <object, TestView>() }; using (var documentViewController = new DocumentViewController(viewHost, viewInfos, dialogParent)) { DialogBoxHandler = (name, wnd) => { var buttonOk = new ControlTester("buttonOk"); buttonOk.Click(); }; // Call bool result = documentViewController.OpenViewForData(data); // Assert Assert.IsTrue(result); Assert.AreEqual(data, view.Data); Assert.IsEmpty(view.Text); } mocks.VerifyAll(); }
public void GeckoListBox_TestGetRectangle() { _countOfItemsDrawn = 0; _itemToNotDrawYetDrawn = false; IWritingSystemDefinition ws = WritingSystemDefinition.Parse("fr"); IWritingSystemDefinition ws2 = WritingSystemDefinition.Parse("en"); _listBox = new GeckoListBox(); _listBox.FormWritingSystem = ws; _listBox.MeaningWritingSystem = ws2; _listBox.Name = "ControlUnderTest"; Assert.IsNotNull(_listBox); String volvo = "Volvo"; String saab = "Saab"; String toyota = "Toyota"; _listBox.AddItem(volvo); _listBox.AddItem(saab); _listBox.AddItem(toyota); _listBox.ItemDrawer = GeckoListBox_TestDrawItem; _listBox.ListCompleted(); Application.DoEvents(); _window.Controls.Add(_listBox); _window.Show(); ControlTester t = new ControlTester("ControlUnderTest", _window); Application.DoEvents(); Rectangle r = _listBox.GetItemRectangle(1); Application.DoEvents(); using (MouseController mc = new MouseController(t)) { mc.Click(r.Right + 5, r.Top + 5); } Application.DoEvents(); Application.DoEvents(); Assert.AreEqual(1, _listBox.SelectedIndex); Assert.AreSame(_listBox.SelectedItem, saab); }
public void ShowDetailsButton_NoMessageSelectedOnEnterKeyDown_DoNotShowMessageWindowDialog() { // Setup using (var form = new Form()) using (MessageWindow messageWindow = ShowMessageWindow(null)) { form.Controls.Add(messageWindow); form.Show(); var gridView = new ControlTester("messagesDataGridView"); // Call gridView.FireEvent("KeyDown", new KeyEventArgs(Keys.Enter)); // Assert // No dialog window shown } }
public void ShowDetailsButton_NoMessageSelectedOnDoubleClick_DoNotShowMessageWindowDialog() { // Setup using (var form = new Form()) using (MessageWindow messageWindow = ShowMessageWindow(null)) { form.Controls.Add(messageWindow); form.Show(); var gridView = new ControlTester("messagesDataGridView"); // Call gridView.DoubleClick(); // Assert // No dialog window shown } }
public void ShowDetailsButton_MessageSelectedOnDoubleClick_ShowMessageWindowDialogWithDetails() { // Setup var mocks = new MockRepository(); var dialogParent = mocks.Stub <IWin32Window>(); mocks.ReplayAll(); const string detailedMessage = "TestDetailedMessage"; using (var form = new Form()) using (MessageWindow messageWindow = ShowMessageWindow(dialogParent)) { form.Controls.Add(messageWindow); form.Show(); string dialogTitle = null; string dialogText = null; DialogBoxHandler = (name, wnd) => { var dialogTester = new FormTester(name); dialogTitle = ((Form)dialogTester.TheObject).Text; var testBoxTester = new TextBoxTester("textBox"); dialogText = testBoxTester.Text; dialogTester.Close(); }; var gridView = new ControlTester("messagesDataGridView"); messageWindow.AddMessage(Level.Warn, new DateTime(), detailedMessage); messageWindow.Refresh(); // Call gridView.FireEvent("CellMouseDoubleClick", new DataGridViewCellMouseEventArgs( 0, 0, 0, 0, new MouseEventArgs(MouseButtons.Left, 2, 0, 0, 0))); // Assert Assert.AreEqual("Berichtdetails", dialogTitle); Assert.AreEqual(detailedMessage, dialogText); } mocks.VerifyAll(); }
public void ShowDetailsButton_MessageSelectedOnDoubleClickOtherThanLeft_DoNotShowMessageWindowDialog(MouseButtons mouseButton) { // Setup using (var form = new Form()) using (MessageWindow messageWindow = ShowMessageWindow(null)) { form.Controls.Add(messageWindow); form.Show(); var gridView = new ControlTester("messagesDataGridView"); messageWindow.AddMessage(Level.Warn, new DateTime(), "TestDetailedMessage"); messageWindow.Refresh(); // Call gridView.FireEvent("CellMouseDoubleClick", new DataGridViewCellMouseEventArgs( 0, 0, 0, 0, new MouseEventArgs(mouseButton, 2, 0, 0, 0))); // Assert // No dialog window shown } }
public void ShowDialog_Always_DefaultProperties() { // Setup mockRepository.ReplayAll(); string settingsDirectory = Path.Combine(testPath, "EmptyWmtsConnectionInfo"); using (new UseCustomSettingsHelper(new TestSettingsHelper { ApplicationLocalUserSettingsDirectory = settingsDirectory })) using (var dialogParent = new Form()) using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent, null)) { // Call dialog.Show(); // Assert var mapLayerLabel = new LabelTester("mapLayerLabel", dialog); Assert.AreEqual("Type kaartlaag", mapLayerLabel.Text); var mapLayers = (ComboBox) new ComboBoxTester("mapLayerComboBox", dialog).TheObject; Assert.IsTrue(mapLayers.Enabled); var groupBoxProperties = new ControlTester("propertiesGroupBox", dialog); Assert.AreEqual("Eigenschappen", groupBoxProperties.Text); var buttonSelect = (Button) new ButtonTester("selectButton", dialog).TheObject; Assert.AreEqual("Selecteren", buttonSelect.Text); Assert.IsTrue(buttonSelect.Enabled); var buttonCancel = (Button) new ButtonTester("cancelButton", dialog).TheObject; Assert.AreEqual("Annuleren", buttonCancel.Text); Assert.AreEqual(500, dialog.MinimumSize.Width); Assert.AreEqual(350, dialog.MinimumSize.Height); } }
public void OpenViewForData_ClickCancelInOpenedDialog_ReturnFalseAndNoViewAddedToViewHost() { // Setup var mocks = new MockRepository(); var dialogParent = mocks.Stub <IWin32Window>(); var viewHost = mocks.StrictMock <IViewHost>(); viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); mocks.ReplayAll(); var data = new object(); var viewInfos = new ViewInfo[] { new ViewInfo <object, TestViewDerivative>(), new ViewInfo <object, TestView>() }; using (var documentViewController = new DocumentViewController(viewHost, viewInfos, dialogParent)) { DialogBoxHandler = (name, wnd) => { var buttonCancel = new ControlTester("buttonCancel"); buttonCancel.Click(); }; // Call bool result = documentViewController.OpenViewForData(data); // Assert Assert.IsFalse(result); } mocks.VerifyAll(); }
public void ShowDetailsButton_DoubleClickOnColumnHeader_DoNotShowMessageWindowDialog() { // Setup using (var form = new Form()) using (MessageWindow messageWindow = ShowMessageWindow(null)) { form.Controls.Add(messageWindow); form.Show(); var gridView = new ControlTester("messagesDataGridView"); messageWindow.AddMessage(Level.Warn, new DateTime(), "TestDetailedMessage"); messageWindow.Refresh(); int columnHeaderRowIndex = ((DataGridView)gridView.TheObject).Columns[0].HeaderCell.RowIndex; // Call gridView.FireEvent("CellMouseDoubleClick", new DataGridViewCellMouseEventArgs( 0, columnHeaderRowIndex, 0, 0, new MouseEventArgs(MouseButtons.Left, 2, 0, 0, 0))); // Assert // No dialog window shown } }
public ButtonControlTester(ControlTester tester, int index) : base(tester, index) { }
/// <summary> /// Creates a ControlTester from a ControlTester and an index where the /// original tester's name is not unique. /// </summary> /// <remarks> /// It is best to use the overloaded Constructor that requires just the name /// parameter if possible. /// </remarks> /// <param name="tester">The ControlTester.</param> /// <param name="index">The index to test.</param> public ListViewTester(ControlTester tester, int index) : base(tester, index) { }
public static void TreeChartWin_Tests(CustomWindowTest formTest, Form mainWin, Form frm, TreeChartKind kind, string stage, string checkXRef) { Assert.IsInstanceOf(typeof(TreeChartWin), frm, stage); TreeChartWin tcWin = frm as TreeChartWin; IBaseWindow curBase = tcWin.Base; Assert.IsNotNull(curBase); Assert.AreEqual(kind, ((ITreeChartWin)tcWin).TreeBox.Model.Kind); tcWin.UpdateSettings(); Assert.IsTrue(tcWin.AllowFilter()); Assert.IsTrue(tcWin.AllowQuickSearch()); Assert.IsTrue(tcWin.AllowPrint()); // forced update tcWin.Refresh(); Assert.Throws(typeof(ArgumentNullException), () => { tcWin.SelectByRec(null); }); GDMIndividualRecord iRec = curBase.GetSelectedPerson(); Assert.AreEqual(checkXRef, iRec.XRef); tcWin.SelectByRec(iRec); KeyDownForm(tcWin.Name, Keys.F5); KeyDownForm(tcWin.Name, Keys.F6); KeyDownForm(tcWin.Name, Keys.F7); //KeyDownForm(tcWin.Name, Keys.F | Keys.Control); tcWin.NavPrev(); tcWin.NavNext(); formTest.ModalFormHandler = TreeFilterDlgTests.TreeFilterDlg_btnAccept_Handler; tcWin.SetFilter(); IList <ISearchResult> search = tcWin.FindAll("Maria"); Assert.AreEqual(1, search.Count); ClickToolStripMenuItem("miGens9", tcWin); ClickToolStripMenuItem("miGens8", tcWin); ClickToolStripMenuItem("miGens7", tcWin); ClickToolStripMenuItem("miGens6", tcWin); ClickToolStripMenuItem("miGens5", tcWin); ClickToolStripMenuItem("miGens4", tcWin); ClickToolStripMenuItem("miGens3", tcWin); ClickToolStripMenuItem("miGens2", tcWin); ClickToolStripMenuItem("miGens1", tcWin); ClickToolStripMenuItem("miGensInf", tcWin); ClickToolStripMenuItem("miModeBoth", tcWin); ClickToolStripMenuItem("miModeAncestors", tcWin); ClickToolStripMenuItem("miModeDescendants", tcWin); ClickToolStripMenuItem("miCertaintyIndex", tcWin); ClickToolStripMenuItem("miTraceKinships", tcWin); ClickToolStripMenuItem("miTraceSelected", tcWin); var ctl = new ControlTester("fTreeBox", frm); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Add)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Subtract)); ctl.FireEvent("KeyDown", new KeyEventArgs(Keys.Back)); ctl.FireEvent("DoubleClick", new EventArgs()); formTest.Mouse.UseOn(ctl); int sx = 10 + 20; int sy = ctl.Properties.Height / 2; formTest.Mouse.Hover(sx, sy); formTest.Mouse.Press(MouseButtons.Left); formTest.Mouse.Hover(sx, sy + 20); // generations control formTest.Mouse.Release(MouseButtons.Left); sx = ctl.Properties.Width - 10 - 30; formTest.Mouse.Hover(sx, sy); formTest.Mouse.Press(MouseButtons.Left); formTest.Mouse.Hover(sx, sy + 20); // scale control formTest.Mouse.Release(MouseButtons.Left); // var tbox = ctl.Properties as TreeChartBox; Assert.IsNotNull(tbox); // handlers tests //ClickToolStripMenuItem("miEdit", tcWin); //ClickToolStripMenuItem("miFatherAdd", tcWin); //ClickToolStripMenuItem("miMotherAdd", tcWin); //ClickToolStripMenuItem("miSpouseAdd", tcWin); //ClickToolStripMenuItem("miSonAdd", tcWin); //ClickToolStripMenuItem("miDaughterAdd", tcWin); //ClickToolStripMenuItem("miFamilyAdd", tcWin); //ClickToolStripMenuItem("miDelete", tcWin); //ClickToolStripMenuItem("miRebuildKinships", tcWin); //ClickToolStripMenuItem("miFillColor", tcWin); //ClickToolStripMenuItem("miFillImage", tcWin); //ClickToolStripMenuItem("miRebuildTree", tcWin); formTest.ModalFormHandler = SaveFileJPG_Handler; ClickToolStripButton("tbImageSave", tcWin); // FIXME exception! //ModalFormHandler = SaveSnapshotEMF_Handler; //ClickToolStripButton("tbImageSave", tcWin); formTest.ModalFormHandler = SaveFileSVG_Handler; ClickToolStripButton("tbImageSave", tcWin); //ModalFormHandler = PrintPreviewDialog_Handler; //ClickToolStripButton("tbDocPrint", fMainWin); try { formTest.ModalFormHandler = PrintDialog_Handler; ClickToolStripButton("tbDocPreview", mainWin); } catch (Exception) { // AppVeyor tests crashed, because "No printers are installed" // No Fail, or Ignore, or etc - not yet divide this test into smaller correct parts } KeyDownForm(frm.Name, Keys.Escape); frm.Dispose(); }
public void BadIndex() { Assert.Throws<ArgumentOutOfRangeException>(delegate { object o = new ControlTester("s")[-1]; }); }
public ButtonControlTester(ControlTester tester, int index) : base(tester, index) { }
///<summary> /// Verifies the text of the named control matches the expected text. ///</summary> public void VerifyText(string controlName, string expectedText) { ControlTester anyControl = new ControlTester(controlName, targetForm.Properties); Assert.AreEqual(expectedText, anyControl.Text); }
public override void Setup() { new LabelTestForm().Show(); label = new ControlTester("myLabel"); }
public void BadIndex() { object o = new ControlTester("s")[-1]; Assert.Fail("Should not find: " + o); }
public override void Setup() { new LabelTestForm().Show(); label = new ControlTester("myLabel"); }
public void BadIndex() { object o = new ControlTester("s")[-1]; Assert.Fail("Should not find: " + o); }
private void PressCtrlN(ControlTester t, bool focusOnFindBox) { ((DictionaryControl)_task.Control).AddNewWord(focusOnFindBox); }
/// <summary> /// Creates a keyboard controller and sets the focus on the control /// indicated by the supplied ControlTester. /// </summary> /// <param name="controlTester">The ControlTester to use the keyboard /// on.</param> public KeyboardController(ControlTester controlTester) : this(new OldSendKeysFactory()) { UseOn(controlTester); }