public void GetStartBarriersTest() { EngineGame game = new EngineGame(); EngineRectangle[] barriers = game.GetStartBarriers(); Assert.IsTrue(barriers.Length == 4); }
public void CheckDeathNotDieTest() { EngineGame game = new EngineGame(); EngineRectangle[] barriers = game.GetStartBarriers(); EngineRectangle square = game.GetStartSquare(); bool die = true; game.EventDie += ((sender, e) => { die = e.Die; }); game.CheckDeath(square, barriers); Assert.IsFalse(die); }
public void CheckDeathDieY2Test() { EngineGame game = new EngineGame(); EngineRectangle[] barriers = game.GetStartBarriers(); EngineRectangle square = new EngineRectangle(new EnginePoint(barriers[1].X + 1, barriers[1].Y - 10), new EngineSize(game.GetStartSquare().Height, game.GetStartSquare().Width)); bool die = false; game.EventDie += ((sender, e) => { die = e.Die; }); game.CheckDeath(square, barriers); Assert.IsTrue(die); }
public void CheckDeathDieXTest() { EngineGame game = new EngineGame(); EngineRectangle[] barriers = game.GetStartBarriers(); EngineRectangle square = new EngineRectangle(barriers[0].Location, game.GetStartSquare().Size); bool die = false; game.EventDie += ((sender, e) => { die = e.Die; }); game.CheckDeath(square, barriers); Assert.IsTrue(die); }