コード例 #1
0
 public void TestXnaTouchLogic()
 {
     using (var resolver = new MockResolver())
     {
         var window = resolver.Window;
         new PixelScreenSpace(window);
         var touch = new XnaMockTouch(window)
         {
             TouchCollection = GetFirstTouchCollection()
         };
         Assert.AreEqual(new Vector2D(0, 0), touch.GetPosition(0));
         Assert.AreEqual(State.Released, touch.GetState(0));
         touch.Run();
         touch.TouchCollection = GetSecondTouchCollection();
         touch.Run();
         touch.TouchCollection = GetThirtTouchCollection();
         touch.Run();
         touch.Update(new Entity[] { });
         if (!touch.IsAvailable)
         {
             return;
         }
         //ncrunch: no coverage start
         Assert.AreEqual(Vector2D.Zero, touch.GetPosition(0));
         Assert.AreEqual(State.Released, touch.GetState(0));
     }             //ncrunch: no coverage end
 }
コード例 #2
0
 public void TestXnaTouchLogic()
 {
     var window = new TestResolver().Resolve<Window>();
     var screen = new PixelScreenSpace(window);
     var touch = new XnaMockTouch(window, screen) { TouchCollection = GetFirstTouchCollection() };
     touch.Run();
     touch.TouchCollection = GetSecondTouchCollection();
     touch.Run();
     touch.TouchCollection = GetThirtTouchCollection();
     touch.Run();
     Assert.True(touch.IsAvailable);
     Assert.AreEqual(Point.Zero, touch.GetPosition(0));
     Assert.AreEqual(State.Released, touch.GetState(0));
 }
コード例 #3
0
		public void TestXnaTouchLogic()
		{
			using (var resolver = new MockResolver())
			{
				var window = resolver.Window;
				new PixelScreenSpace(window);
				var touch = new XnaMockTouch(window) { TouchCollection = GetFirstTouchCollection() };
				Assert.AreEqual(new Vector2D(0, 0), touch.GetPosition(0));
				Assert.AreEqual(State.Released, touch.GetState(0));
				touch.Run();
				touch.TouchCollection = GetSecondTouchCollection();
				touch.Run();
				touch.TouchCollection = GetThirtTouchCollection();
				touch.Run();
				touch.Update(new Entity[] { });
				if (!touch.IsAvailable)
					return;
				//ncrunch: no coverage start
				Assert.AreEqual(Vector2D.Zero, touch.GetPosition(0)); 
				Assert.AreEqual(State.Released, touch.GetState(0));
			} //ncrunch: no coverage end
		}