Ejemplo n.º 1
0
        public void BaseDamage()
        {
            //Arrange
            Move newMove      = new Move("thunderbolt", 95, "special", "zappy boi", "par 10", 15, 70);
            Mon  attackingMon = new Mon("Raichu-Alola", 50, 60, 85, 50, 95, 85, 110);

            attackingMon.Save();

            Mon defendingMon = new Mon("Golduck", 50, 80, 82, 78, 95, 80, 85);

            defendingMon.Save();

            Battle attacking = attackingMon.GetAllTrueStats();
            Battle defending = defendingMon.GetAllTrueStats();

            attacking.Save();
            attacking.SetPlayerMon();
            attacking.SetActiveMon();
            defending.Save();
            defending.SetComputerMon();
            defending.SetActiveMon();

            //Act
            int           result    = Battle.BaseDamage(attacking.GetBattleId(), newMove);
            List <Battle> emptyList = new List <Battle> {
            };

            //Assert
            Console.WriteLine(result);
            Assert.AreEqual(50, result);
        }
Ejemplo n.º 2
0
        public ActionResult DoBattle(int id)
        {
            Battle.DeleteAll();
            Mon    playerMon = Mon.Find(id);
            Battle newPlayer = playerMon.GetAllTrueStats();

            newPlayer.Save();
            newPlayer.SetPlayerMon();
            newPlayer.SetActiveMon();
            Battle.ComputerChoice(id);
            return(RedirectToAction("Combat"));
        }
Ejemplo n.º 3
0
        public void GetAllTrueStats_Test()
        {
            //Arrange
            Mon newMon = new Mon("Rattata", 50, 30, 56, 35, 25, 35, 72);

            newMon.Save();
            Battle expectedResult = new Battle(newMon.GetMonId(), "Rattata", 50, 105, 105, 105, 76, 55, 45, 55, 92);

            //Act

            Battle result = newMon.GetAllTrueStats();

            //Assert
            Assert.AreEqual(expectedResult, result);
        }