Inheritance Hierarchy
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
The MouseTapTriggerTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MouseTapTriggerTests | Initializes a new instance of the MouseTapTriggerTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreateMouseTapTriggerBySendingButtonName | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
Tap |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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