public void SetUp() { mouse = Resolve<Mouse>() as MockMouse; if (mouse != null) mouse.SetPosition(Vector2D.Zero); AdvanceTimeAndUpdateEntities(); }
public void ZoomCamera() { mockMouse = Resolve<Mouse>() as MockMouse; AdvanceTimeAndUpdateEntities(); Assert.AreEqual(new Vector2D(0.5f, 0.5f), spriteSheetPreviewer.currentDisplayAnimation.Center); mockMouse.SetButtonState(MouseButton.Middle, State.Pressed); mockMouse.SetPosition(new Vector2D(1f, 1f)); AdvanceTimeAndUpdateEntities(); Assert.AreEqual(0.5f, spriteSheetPreviewer.currentDisplayAnimation.DrawArea.Width); }
private void InitializeMouse() { mouse = Resolve<Mouse>() as MockMouse; if (mouse != null) mouse.SetPosition(Vector2D.Zero); }
private void InitializeMouse() { mouse = Resolve<Mouse>() as MockMouse; if (mouse == null) return; //ncrunch: no coverage mouse.SetPosition(Vector2D.Zero); AdvanceTimeAndUpdateEntities(); }
//ncrunch: no coverage end private void InitializeKeyboardAndMouse() { keyboard = Resolve<Keyboard>() as MockKeyboard; lastKey = Key.None; mouse = Resolve<Mouse>() as MockMouse; if (mouse == null) return; //ncrunch: no coverage mouse.SetPosition(Vector2D.Zero); AdvanceTimeAndUpdateEntities(); }
private void AdvanceMouseTick(MockMouse mouse, State state, Vector2D position) { mouse.SetButtonState(MouseButton.Left, state); mouse.SetPosition(position); AdvanceTimeAndUpdateEntities(); }