public void TestGameRunning() { Game.Start(3); Assert.AreEqual(3, Game.Obstacles.Count); Assert.AreEqual(0, Game.Blasts.Count); Assert.AreNotEqual(0, Game.Player.Speed); }
public void TestSingleShotFiring() { var game = new GameModel(Sizes.Collection["game"], new Point(20, 100)); game.Start(0); game.Fire(); Assert.AreEqual(1, game.Blasts.Count); }
public void TestObstacleIntersectionWithPlayer() { var game = new GameModel(Sizes.Collection["game"], new Point(20, 100)); game.Start(1); var obstacle = game.Obstacles.First(); obstacle.SetLocation(20, 100); Assert.AreEqual(true, obstacle.IntersectsWithPlayer(game.Player)); }
public void TestShootingLimitation() { var game = new GameModel(Sizes.Collection["game"], new Point(20, 100)); game.Start(0); game.ShotsLimit = 2; for (var i = 0; i < 3; i++) { game.Fire(); } Assert.AreEqual(2, game.Blasts.Count); }
public void TestSeveralShotsFiring() { var game = new GameModel(Sizes.Collection["game"], new Point(20, 100)); game.Start(0); game.ShotsLimit = 7; var shotsCount = new Random().Next(0, 6); for (var i = 0; i < shotsCount; i++) { game.Fire(); } Assert.AreEqual(shotsCount, game.Blasts.Count); }
private void Start() { _game.Start(true); }