Exemple #1
0
 public void VerifyInitialization()
 {
     var beeType = new BeeType { Name = "Test bee", DamagePerHit = 5, MaxHitPoints = 10, InitialNumberOfBees = 1 };
     var bee = new Bee(beeType);
     Assert.AreEqual(10, bee.HitPoints);
     Assert.AreSame(beeType, bee.BeeType);
 }
Exemple #2
0
 public void VerifyBeeDeadWhenKillCalled()
 {
     var bee = new Bee(new BeeType { Name = "A Bee", DamagePerHit = 7, MaxHitPoints = 50, InitialNumberOfBees = 1 });
     bee.Kill();
     Assert.IsTrue(bee.IsDead);
     Assert.IsTrue(bee.HitPoints==0);
 }
Exemple #3
0
 private ActionResult GameView(BeeGame game, Bee bee)
 {
     StoreGame(game);
     var model = new BeeGameModel { BeeGame = game, HitBee = bee, };
     return View("GameView", model);
 }
Exemple #4
0
 public void VerifyIsDeadReturnsTrueWhenDead()
 {
     var bee = new Bee(new BeeType { Name = "Dead in one hit bee", DamagePerHit = 7, MaxHitPoints = 5, InitialNumberOfBees = 1 });
     var result = bee.Hit();
     Assert.IsTrue(bee.IsDead);
 }
Exemple #5
0
 public void VerifyHitPointsAreReducedOnHit()
 {
     var bee = new Bee(new BeeType { Name = "Test bee", DamagePerHit = 5, MaxHitPoints = 10, InitialNumberOfBees = 1 });
     bee.Hit();
     Assert.AreEqual(5, bee.HitPoints);
 }