public void SetUp()
 {
     mouse = Resolve<Mouse>() as MockMouse;
     if (mouse != null)
         mouse.SetPosition(Vector2D.Zero);
     AdvanceTimeAndUpdateEntities();
 }
 public void Setup()
 {
     soundPreviewer = new SoundPreviewer();
     soundPreviewer.PreviewContent("Sound");
     mockMouse = Resolve<Mouse>() as MockMouse;
     AdvanceTimeAndUpdateEntities();
 }
 public void Setup()
 {
     spriteSheetPreviewer = new SpriteSheetPreviewer();
     spriteSheetPreviewer.PreviewContent("DeltaEngineLogo");
     mockMouse = Resolve<Mouse>() as MockMouse;
     AdvanceTimeAndUpdateEntities();
 }
 public void Setup()
 {
     particlePreviewer = new ParticlePreviewer();
     particlePreviewer.PreviewContent("TestParticle");
     new Camera2DScreenSpace(Resolve<Window>());
     mockMouse = Resolve<Mouse>() as MockMouse;
     AdvanceTimeAndUpdateEntities();
 }
		public void MoveCamera()
		{
			mockMouse = Resolve<Mouse>() as MockMouse;
			AdvanceTimeAndUpdateEntities();
			mockMouse.SetButtonState(MouseButton.Left, State.Pressed);
			AdvanceTimeAndUpdateEntities();
			Assert.IsTrue(musicPreviewer.music.IsPlaying());
		}
 public void PlaySound()
 {
     soundPreviewer.sound.CreateSoundInstance();
     mockMouse = Resolve<Mouse>() as MockMouse;
     AdvanceTimeAndUpdateEntities();
     mockMouse.SetButtonState(MouseButton.Left, State.Pressed);
     AdvanceTimeAndUpdateEntities();
     Assert.AreEqual(1, soundPreviewer.sound.NumberOfInstances);
 }
 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);
 }
 public void SetUp()
 {
     selector = new EntitySelector();
     ellipse = new Ellipse(Vector2D.Half, 0.1f, 0.1f, Color.Blue);
     mouse = Resolve<Mouse>() as MockMouse;
 }
 public void SetUp()
 {
     mouse = Resolve<Mouse>() as MockMouse;
 }
 public void CreateContentViewModel()
 {
     contentManagerViewModel = new ContentManagerViewModel(new MockService("User", "LogoApp"));
     mockMouse = new MockMouse();
     AdvanceTimeAndUpdateEntities();
 }
Example #11
0
		private void DragMouse(MockMouse mouse, float x, float y)
		{
			SetStateAndPosition(mouse, State.Pressing, new Vector2D(x, y));
			SetStateAndPosition(mouse, State.Pressed, new Vector2D(x - 0.1f, y));
			SetStateAndPosition(mouse, State.Releasing, new Vector2D(x - 0.2f, y));
		}
Example #12
0
 private void InitializeMouse()
 {
     mouse = Resolve<Mouse>() as MockMouse;
     if (mouse == null)
         return; //ncrunch: no coverage
     mouse.SetPosition(Vector2D.Zero);
     AdvanceTimeAndUpdateEntities();
 }
Example #13
0
 public void SetUp()
 {
     displayMode = ScreenSpace.Current.Viewport.Aspect >= 1.0f
         ? Orientation.Landscape : Orientation.Portrait;
     mockResolver = new MockResolver();
     mockKeyboard = mockResolver.Resolve<MockKeyboard>();
     mockMouse = mockResolver.Resolve<MockMouse>();
     mockTouch = mockResolver.Resolve<MockTouch>();
     content = new JewelBlocksContent();
     game = new Game(Resolve<Window>());
 }
Example #14
0
 //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.SetNativePosition(position);
			AdvanceTimeAndUpdateEntities();
		}
 private void InitializeMouse()
 {
     mouse = Resolve<Mouse>() as MockMouse;
     if (mouse != null)
         mouse.SetPosition(Vector2D.Zero);
 }
Example #17
0
		private void ClickAtPosition(MockMouse mouse, Vector2D position)
		{
			SetStateAndPosition(mouse, State.Pressing, position);
			SetStateAndPosition(mouse, State.Releasing, position);
		}