public void TestHeal() { var bagel = new BagelEnemy(BagelType.Healing, health: 1); var entity = new Entity(health: 5); bagel.OnCollideWithTarget(entity); Assert.AreEqual(6, entity.Health); }
public void TestDyingOutside() { var game = new Game(200, 200); var bagel = new BagelEnemy(BagelType.Basic, game, game, 50, 50, -100, -100); Assert.IsFalse(bagel.IsDead); bagel.Move(); Assert.IsTrue(bagel.IsDead); }
public void TestCollisionBoxChangingAfterDamage() { var bagel = new BagelEnemy(BagelType.Basic, null, null, health: 3); var oldCBW = bagel.CollisionBox.Width; var oldCBH = bagel.CollisionBox.Height; bagel.DamageEntity(null, 1); Assert.IsTrue(oldCBW > bagel.CollisionBox.Width); Assert.IsTrue(oldCBH > bagel.CollisionBox.Height); }
public void TestInvincibleCloneDyingEarly() { var game = new Game(200, 200); var bagel = new BagelEnemy(BagelType.InvincibleClone, game, game, health: 3); bagel.DamageEntity(null, 1); Assert.IsFalse(bagel.IsDead); bagel.DamageEntity(null, 1); Assert.IsTrue(bagel.IsDead); }
public void TestBouncing() { var game = new Game(200, 200); var bagel = new BagelEnemy(BagelType.Bouncing, game, game, 50, 50, -100, -100); Assert.IsFalse(bagel.IsDead); bagel.Move(); Assert.IsFalse(bagel.IsDead); Assert.AreEqual(100, bagel.VelX); Assert.AreEqual(100, bagel.VelY); }
public void TestOnEntityKilledByPlayerBullet() { var game = new Game(100, 100); var prevScore = game.Score; var enemy = new BagelEnemy(BagelType.Basic, game, game, 50, 50, 0, 0, 1, 0); var bullet = new Bullet(game.Player, game, TargetType.Enemy, 50, 50, 0, 0, 0, 1, 1); game.AddEntity(enemy); game.AddEntity(bullet); game.GameTick(); Assert.IsTrue(prevScore < game.Score); }
public void TestFiringClonesBagel() { var game = new Game(200, 200); var bagel = new BagelEnemy(BagelType.Clone, game, game, health: 10); game.AddEntity(bagel); for (var i = 0; i < BagelEnemy.ShootingInterval; i++) { bagel.OnEntityTick(); } game.GameTick(); Assert.AreEqual(6, game.GetEntities.Count()); }
public void TestGetDrawingAction() { var texture = new BagelEnemy(BagelType.Basic).GetDrawingAction(); }
public void TestCreate() { var bagel = new BagelEnemy(BagelType.Basic); }