Exemple #1
0
        public void playing_game_moves_player()
        {
            SetUp();

            var originalPlayerPosition = _player1.GetLocation();

            try
            {
                // Will throw an argument null error because console input
                // is not given so we need to catch it to perform the test
                _gameOfMonopoly.PlayGame();
            }
            catch (ArgumentNullException)
            {
                var expectedPlayerLocation = originalPlayerPosition + _player1.GetLastMove();
                var actualLocation         = _player1.GetLocation();

                // Player's new location should be it's original
                // location plus the last move rolled for them
                Assert.AreEqual(expectedPlayerLocation, actualLocation);
            }
        }