Пример #1
0
        public void Can_assign_UserName_To_New_Player()
        {
            var player = new Player("daft");

            var expected = "daft";
            Assert.AreEqual(expected, player.UserName);
        }
Пример #2
0
        public void Can_Assign_User_Name_To_New_Player()
        {
            var player = new Player();

            var expected = "*****@*****.**";
            player.ChangeEmail("*****@*****.**");

            Assert.AreEqual(expected, player.Email);
        }
Пример #3
0
        public void Game_Has_Correct_Life_Total_For_2_Player_Standard_Constructed()
        {
            var playerOne = new Player();
            var playerTwo = new Player();

            var game = new Game(playerOne, playerTwo, GameType.StandardConstructed);
            int expected = 20;

            Assert.AreEqual(expected, game.PlayerOneLifeTotal);
            Assert.AreEqual(expected, game.PlayerTwoLifeTotal);
        }
Пример #4
0
        public Game(Player playerOne, Player playerTwo, GameType gameType)
        {
            m_GameType = gameType;

            m_PlayerOne = playerOne;
            m_PlayerTwo = playerTwo;

            m_PlayerOneLifeTotal = 20;
            m_PlayerTwoLifeTotal = 20;

            m_NumberOfPlayers = 2;
        }
Пример #5
0
        public Game(GameType gameType)
        {
            m_GameType = gameType;
            //Temp players if life tracker is publically vailable
            m_PlayerOne = new Player("Player1");
            m_PlayerTwo = new Player("Player2");

            m_PlayerOneLifeTotal = 20;
            m_PlayerTwoLifeTotal = 20;

            m_NumberOfPlayers = 2;
        }
Пример #6
0
        public void Can_Add_Game_Stat_To_Player()
        {
            var player = new Player("daft", "*****@*****.**");
            var result = new GameResult();

            var opponent = new Player("dork", "*****@*****.**");
            var date = new DateTime(2011, 12, 24, 16, 0, 0);

            var expected = new GameResult(GameResultEnum.Win, opponent, date);

            player.AddGameResult(result);

            Assert.AreEqual(1, player.MatchHistory.Count);
        }
Пример #7
0
        public void Player_Life_Totals_Can_Be_Decreased()
        {
            var playerOne = new Player();
            var playerTwo = new Player();

            var game = new Game(playerOne, playerTwo, GameType.StandardConstructed);
            int expectedPlayerOne = 18;
            int expectedPlayerTwo = 15;

            game.DecreasePlayerOneLife(2);
            game.DecreasePlayerTwoLife(5);

            Assert.AreEqual(expectedPlayerOne, game.PlayerOneLifeTotal);
            Assert.AreEqual(expectedPlayerTwo, game.PlayerTwoLifeTotal);
        }
Пример #8
0
 public GameResult(GameResultEnum gameResultEnum, Player opponent, DateTime gameDate)
 {
     m_Result = gameResultEnum;
     m_Opponent = opponent;
     m_GameDate = gameDate;
 }