InputCommandsTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Input.Tests InputCommandsTests

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

public class InputCommandsTests : TestWithMocksOrVisually

The InputCommandsTests type exposes the following members.

Constructors

  NameDescription
Public methodInputCommandsTests
Initializes a new instance of the InputCommandsTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCountPressingAndReleasing
Public methodGetInputCommands
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodZoomOnLines
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, Timeout(5000)]
public void CountPressingAndReleasing()
{
    int pressed = 0;
    int released = 0;
    var fontText = new FontText(Font.Default,
        "MouseLeft pressed: " + pressed + " released: " + released, Rectangle.One);
    //ncrunch: no coverage start 
    new Command(
        () => fontText.Text = "MouseLeft pressed: " + ++pressed + " released: " + released).Add(
            new MouseButtonTrigger());
    new Command(
        () => fontText.Text = "MouseLeft pressed: " + pressed + " released: " + ++released).Add(
            new MouseButtonTrigger(MouseButton.Left, State.Releasing));
    //ncrunch: no coverage end
}
[Test, CloseAfterFirstFrame]
public void GetInputCommands()
{
    var inputCommands = ContentLoader.Load<InputCommands>("DefaultCommands");
    if (inputCommands.MetaData != null)
        Assert.AreEqual(ContentType.InputCommand, inputCommands.MetaData.Type);
}
[Test, Ignore]
public void ZoomOnLines()
{
    var line1 = new Line2D(new List<Vector2D>
    {
        new Vector2D(0.4f, 0.4f),
        new Vector2D(0.6f, 0.4f),
        new Vector2D(0.4f, 0.6f),
        new Vector2D(0.6f, 0.6f),
        new Vector2D(0.4f, 0.5f),
        new Vector2D(0.5f, 0.5f)
    }, Color.Red);
    new Command("Zoom", zoomAmount => ZoomLinePoints(line1.Points, zoomAmount));
}
See Also