//[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 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(); }
public void TextReflectsKeystrokes() { IWritingSystemDefinition ws = WritingSystemDefinition.Parse("fr"); IWeSayTextBox textBox = new WeSayTextBox(ws, "_textToSearchForBox"); _window.Controls.Add((Control)textBox); _window.Show(); TextBoxTester t = new TextBoxTester("_textToSearchForBox", _window); KeyboardController keyboardController = new KeyboardController(t); t.Properties.Focus(); keyboardController.Press("Test"); keyboardController.Press("e"); keyboardController.Press("s"); keyboardController.Press("t"); Assert.IsTrue(textBox.Text.Equals("Testest")); keyboardController.Dispose(); }
public void TearDown() { keyboardController.Dispose(); textBoxForm.Close(); }