Пример #1
0
 public void ShouldLevelPlayerUpWhenBotDefeated()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleMode = BattleMode.PlayerVsComputer,
             BattleStatus = BattleStatus.InBattle,
             BattleTurn = Alliance.TeamOne
         },
         Player = new Player()
     };
     g.Player.SetName("Player");
     var b = new Dumbass();
     b.SetName("Idiot");
     g.Tournament.AddCharacterToTournament(b);
     g.StartPlayerVsComputerTournament();
     g.CurrentBattleDetails.Arena.Characters.First(i => i is Dumbass).LoseHealth(200);
     g.EndBattle(g.Player.GetAlliance());
     g.ProcessBattleOver();
     Assert.IsTrue(g.Player.GetLevel() == 2);
 }
Пример #2
0
 public void ShouldThrowExceptionIfPostBattleProcessAttemptedBeforeBattleOver()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleStatus = BattleStatus.InBattle
         }
     };
     g.ProcessBattleOver();
 }
Пример #3
0
 public void ShouldResetCharacterAfterBattle()
 {
     const int playerStartingHealth = 150;
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleMode = BattleMode.PlayerVsComputer,
             BattleStatus = BattleStatus.InBattle,
             BattleTurn = Alliance.TeamOne
         },
         Player = new Player()
     };
     g.Player.SetName("Player");
     var b = new Dumbass();
     b.SetName("Idiot");
     g.Tournament.AddCharacterToTournament(b);
     g.StartPlayerVsComputerTournament();
     g.CurrentBattleDetails.Arena.Characters.First(i => i is Player).LoseHealth(50);
     Assert.IsTrue(g.Player.Health == playerStartingHealth - 50);
     g.EndBattle(g.Player.GetAlliance());
     g.ProcessBattleOver();
     Assert.IsTrue(g.Player.Health == playerStartingHealth);
 }