Beispiel #1
0
        public void CanCheckWhoTheWinnerIs()
        {
            RollADice        newDiceRoll = new RollADice();
            Player           newPlayer   = new Player("Lotto");
            Player           newPlayer1  = new Player("Jimmi");
            PlayerRepository playerRepo  = new PlayerRepository();

            playerRepo.AddPlayerToList(newPlayer);
            playerRepo.AddPlayerToList(newPlayer1);

            Assert.AreEqual("Lotto Wins!", newDiceRoll.winOrLose(6, 2));
            Assert.AreEqual("Jimmi Wins!", newDiceRoll.winOrLose(3, 5));
            Assert.AreEqual("It's A Draw!", newDiceRoll.winOrLose(4, 4));
        }
Beispiel #2
0
        public string WhoIsTheWinner(string resultOne, string resultTwo)
        {
            RollADice newRoll = new RollADice();

            string winner;

            winner = newRoll.winOrLose(int.Parse(resultOne), int.Parse(resultTwo));

            return(winner);
        }