From 9e0bdcd9dc29edaedb6b539ae8414a1d09b22d7d Mon Sep 17 00:00:00 2001 From: "SND\\rene87_cp" Date: Sun, 19 Feb 2012 12:47:24 +0000 Subject: [PATCH] improve Mouse and GamePad test --- .../Strukturen/Input/GamePadTest.cs | 6 ++++-- .../Strukturen/Input/MouseTest.cs | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs b/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs index 857df23d..a4f48c9a 100644 --- a/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs +++ b/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs @@ -95,8 +95,10 @@ namespace ANX.Framework.TestCenter.Strukturen.Input public void Setup() { AddInSystemFactory.Instance.Initialize(); - AddInSystemFactory.Instance.SetPreferredSystem(AddInType.InputSystem, "Test"); - + if (AddInSystemFactory.Instance.GetPreferredSystem(AddInType.InputSystem) == null) + { + AddInSystemFactory.Instance.SetPreferredSystem(AddInType.InputSystem, "Test"); + } } [TestCaseSource("playergets")] diff --git a/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs b/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs index d3bae980..f76e6d94 100644 --- a/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs +++ b/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs @@ -76,9 +76,10 @@ namespace ANX.Framework.TestCenter.Strukturen.Input public void Setup() { AddInSystemFactory.Instance.Initialize(); - AddInSystemFactory.Instance.SetPreferredSystem( - AddInType.InputSystem, "Test"); - + if (AddInSystemFactory.Instance.GetPreferredSystem(AddInType.InputSystem) == null) + { + AddInSystemFactory.Instance.SetPreferredSystem(AddInType.InputSystem, "Test"); + } } [TestCaseSource("twoInt")] @@ -87,6 +88,14 @@ namespace ANX.Framework.TestCenter.Strukturen.Input ANXMouse.SetPosition(x, y); AssertHelper.ConvertEquals(new ANXMouseState(x, y, 0, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released), ANXMouse.GetState(), "GetState"); - } + } + [TestCaseSource("twoInt")] + public void WindowHandle(int x, int y) + { + ANXMouse.SetPosition(x, y); + ANXMouse.WindowHandle = new IntPtr(x); + AssertHelper.ConvertEquals((int)ANXMouse.WindowHandle, x, "WindowHandle"); + + } } }