示例#1
0
 public void testShouldMoveAccordingToYVelocity()
 {
     Bullet bullet = new Bullet(new MockViewFactory(100, 100, 10, 10));
     bullet.Position = new Vector2(50, 50);
     bullet.YVelocity = -10;
     bullet.Update(gameTimeWithOneSecond());
     Assert.AreEqual(new Vector2(50, 40), bullet.Position);
 }
示例#2
0
 public void testShouldKillItselfWhenReachingTheEdgeOfTheView()
 {
     Bullet bullet = new Bullet(new MockViewFactory(100, 100, 10, 10));
     bullet.Position = new Vector2(50, 10);
     bullet.YVelocity = -10;
     bullet.Alive = true;
     bullet.Update(gameTimeWithOneSecond());
     Assert.AreEqual(false, bullet.Alive);
 }