Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Scenes.Tests.Controls.LabelTests
Tests: DeltaEngine.Scenes.Tests.Controls.ButtonTests
Tests: DeltaEngine.Scenes.Tests.Controls.InteractiveButtonTests
Tests: DeltaEngine.Scenes.Tests.Controls.RadioButtonTests
Tests: DeltaEngine.Scenes.Tests.Controls.TextBoxTests
6 unit tests call DeltaEngine.Scenes.Controls.Label.Text
2 unit tests call DeltaEngine.Scenes.Controls.Label.Text
2 unit tests call DeltaEngine.Scenes.Controls.Label.Text
1 unit tests call DeltaEngine.Scenes.Controls.Label.Text
10 unit tests call DeltaEngine.Scenes.Controls.Label.Text
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: StringRemarks
Remarks
Remarks
Remarks
Remarks
Examples
[Test, CloseAfterFirstFrame] public void InitialText() { Assert.AreEqual("Hello World", label.Text); Assert.AreEqual("Hello World", label.PreviousText); }
[Test, CloseAfterFirstFrame] public void ChangeTextOnce() { label.Text = "Change 1"; Assert.AreEqual("Change 1", label.Text); Assert.AreEqual("Hello World", label.PreviousText); }
[Test, CloseAfterFirstFrame] public void ChangeTextTwice() { label.Text = "Change 1"; label.Text = "Change 2"; Assert.AreEqual("Change 2", label.Text); Assert.AreEqual("Change 1", label.PreviousText); }
Examples
[Test] public void DrawLoadedButton() { button.Text = "Original"; var stream = BinaryDataExtensions.SaveToMemoryStream(button); var loadedButton = (Button)stream.CreateFromMemoryStream(); loadedButton.Text = "Loaded"; loadedButton.DrawArea = loadedButton.DrawArea.Move(0.0f, 0.15f); }
[Test, Ignore] //ncrunch: no coverage start public void LoadWithoutBinaryDataExtensions() { var stream = BinaryDataExtensions.SaveToMemoryStream(button); button.Text = "Original"; var loadedButton = new Button(); loadedButton.LoadFromStream(stream); Assert.AreEqual(Center, loadedButton.DrawArea); Assert.AreEqual("Click Me", loadedButton.Text); loadedButton.DrawArea = loadedButton.DrawArea.Move(new Vector2D(0.0f, 0.2f)); }
Examples
[Test] public void DrawLoadedButton() { button.Text = "Original"; var stream = BinaryDataExtensions.SaveToMemoryStream(button); var loadedButton = (InteractiveButton)stream.CreateFromMemoryStream(); loadedButton.Text = "Loaded"; loadedButton.DrawArea = loadedButton.DrawArea.Move(0.0f, 0.15f); }
[Test, CloseAfterFirstFrame, Ignore] public void LoadWithoutBinaryDataExtensions() { var stream = BinaryDataExtensions.SaveToMemoryStream(button); button.Text = "Original"; var loadedButton = new InteractiveButton(); loadedButton.LoadFromStream(stream); Assert.AreEqual(Center, loadedButton.DrawArea); Assert.AreEqual("Click Me", loadedButton.Text); loadedButton.DrawArea = loadedButton.DrawArea.Move(new Vector2D(0.0f, 0.2f)); }
Examples
[Test] public void SaveAndLoad() { centerButton.Text = "Original"; var stream = BinaryDataExtensions.SaveToMemoryStream(centerButton); var loadedButton = (RadioButton)stream.CreateFromMemoryStream(); loadedButton.Text = "Loaded"; Assert.AreEqual(Center, loadedButton.DrawArea); loadedButton.DrawArea = loadedButton.DrawArea.Move(new Vector2D(0.0f, 0.1f)); }
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 TypingHasNoEffectIfTextBoxDoesNotHaveFocus() { topTextBox.Text = ""; PressKey(Key.A); Assert.AreEqual("", topTextBox.Text); }
See Also