MouseButtonTriggerTests IsTriggered Method Delta Engine Documentation

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

public void IsTriggered()
Examples

[Test, CloseAfterFirstFrame]
public void IsTriggered()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var trigger = new MouseButtonTrigger(MouseButton.Right, State.Pressed);
    bool invoked = false;
    trigger.Invoked += () => invoked = true;
    var mouse = Resolve<MockMouse>();
    mouse.SetButtonState(MouseButton.Right, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    Assert.True(invoked);
}
See Also