Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Input.Tests TouchRotateTriggerTests
Namespace: DeltaEngine.Input.Tests
Assembly: DeltaEngine.Input.Tests (in DeltaEngine.Input.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The TouchRotateTriggerTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TouchRotateTriggerTests | Initializes a new instance of the TouchRotateTriggerTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
Angle | ||
Creation | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
ShowRedSquare |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void ShowRedSquare() { new FontText(Font.Default, "Pinch screen to show red circle", Rectangle.One); var rect = new FilledRect(new Rectangle(0.1f, 0.1f, 0.1f, 0.1f), Color.Red); var trigger = new TouchRotateTrigger(); var touch = Resolve<Touch>(); new Command(() => //ncrunch: no coverage start { rect.Center = touch.GetPosition(0); rect.RotationCenter = rect.Center; rect.Rotation = trigger.Angle; }).Add(trigger); //ncrunch: no coverage end }
[Test, CloseAfterFirstFrame] public void Angle() { var touch = Resolve<Touch>() as MockTouch; if (touch == null) return; //ncrunch: no coverage var trigger = new TouchRotateTrigger(); touch.SetTouchState(0, State.Pressing, new Vector2D(0.5f, 0.1f)); touch.SetTouchState(1, State.Pressed, new Vector2D(0.5f, 0.7f)); touch.Update(new[] { trigger });
[Test, CloseAfterFirstFrame] public void Creation() { Assert.DoesNotThrow(() => new TouchRotateTrigger()); Assert.Throws<TouchRotateTrigger.TouchRotateTriggerHasNoParameters>( () => new TouchRotateTrigger(new Dictionary<string, string> { { "Button", "Left" } })); }
See Also