RadioButtonTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Scenes.Tests.Controls RadioButtonTests

Namespace: DeltaEngine.Scenes.Tests.Controls
Assembly: DeltaEngine.Scenes.Tests (in DeltaEngine.Scenes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class RadioButtonTests : TestWithMocksOrVisually

The RadioButtonTests type exposes the following members.

Constructors

  NameDescription
Public methodRadioButtonTests
Initializes a new instance of the RadioButtonTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodDefaultsToEnabled
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Public methodRenderRadioButton
Public methodRenderRadioButtonAttachedToMouse
Public methodRenderThreeRadioButtonsWithTheMiddleDisabled
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSaveAndLoad
Public methodSetUp
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, ApproveFirstFrameScreenshot]
public void RenderThreeRadioButtonsWithTheMiddleDisabled()
{
    new RadioButton(Top, "Hello");
    new RadioButton(Bottom, "Hey");
    centerButton.IsEnabled = false;
    AdvanceTimeAndUpdateEntities();
    Assert.AreEqual(Color.DarkGray, centerButton.Color);
}
[Test, CloseAfterFirstFrame]
public void DefaultsToEnabled()
{
    Assert.IsTrue(centerButton.IsEnabled);
    Assert.AreEqual(Color.Gray, centerButton.Color);
}
[Test]
public void RenderRadioButtonAttachedToMouse()
{
    new Command(
        point => centerButton.DrawArea = Rectangle.FromCenter(point, centerButton.DrawArea.Size)).
        Add(new MouseMovementTrigger());
}
[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));
}
See Also