MouseTapTriggerTests ClassDelta Engine Documentation
Inheritance Hierarchy

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

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

public class MouseTapTriggerTests : TestWithMocksOrVisually

The MouseTapTriggerTests type exposes the following members.

Constructors

  NameDescription
Public methodMouseTapTriggerTests
Initializes a new instance of the MouseTapTriggerTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreateMouseTapTriggerBySendingButtonName
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 methodTap
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void Tap()
{
    var mouse = Resolve<Mouse>() as MockMouse;
    if (mouse == null)
        return; //ncrunch: no coverage 
    bool wasTapped = false;
    new Command(() => wasTapped = true).Add(new MouseTapTrigger(MouseButton.Left));
    SetMouseState(mouse, State.Pressing, Vector2D.Half);
    Assert.IsFalse(wasTapped);
    SetMouseState(mouse, State.Releasing, Vector2D.Half);
    Assert.IsTrue(wasTapped);
}
[Test]
public void CreateMouseTapTriggerBySendingButtonName()
{
    var trigger = new MouseTapTrigger(new Dictionary<string, string> { { "Button", "Middle" } });
See Also