Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Scenes.Tests.Controls.TextBoxTests
4 unit tests call DeltaEngine.Scenes.Controls.TextBox.HasFocus
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: BooleanRemarks
Examples
[Test, CloseAfterFirstFrame] public void ClickingTextBoxGivesItFocus() { if (!IsMockResolver) return; //ncrunch: no coverage Assert.IsFalse(topTextBox.State.HasFocus); PressAndReleaseMouse(Vector2D.One); Assert.IsFalse(topTextBox.State.HasFocus); PressAndReleaseMouse(Top.Center); Assert.IsTrue(topTextBox.State.HasFocus); }
[Test, CloseAfterFirstFrame] public void ClickingOneTextBoxCausesOtherTextBoxToLoseFocus() { if (!IsMockResolver) return; //ncrunch: no coverage PressAndReleaseMouse(Top.Center); Assert.IsTrue(topTextBox.State.HasFocus); Assert.IsFalse(bottomTextBox.State.HasFocus); PressAndReleaseMouse(Bottom.Center); Assert.IsFalse(topTextBox.State.HasFocus); Assert.IsTrue(bottomTextBox.State.HasFocus); Assert.AreEqual(Color.Gray, topTextBox.Color); Assert.AreEqual(Color.LightGray, bottomTextBox.Color); }
[Test, CloseAfterFirstFrame] public void ClickingTextBoxDoesNotGivesItFocusIfItIsDisabled() { topTextBox.IsEnabled = false; PressAndReleaseMouse(Top.Center); Assert.IsFalse(topTextBox.State.HasFocus); }
See Also