예제 #1
0
 public void ItGeneratesPlayersWithUserInput()
 {
     //Given
     var playersInput = new List<string> { "2", "1 4 2", "2 2 0" };
     //When
     var players = new Players().InitWith(playersInput).PlayersMap;
     //Then
     Assert.AreEqual(2, players.Count);
     Assert.AreEqual(new Tuple<int, int>(4, 2), players["1"]);
     Assert.AreEqual(new Tuple<int, int>(2, 0), players["2"]);
 }
예제 #2
0
        public void ItIteratesOverPlayersToFindAWinner()
        {
            //Given
            string userInput = "1 2\nG T\n2\n1 0 1\n2 0 0";

            //When
            Maze maze = new Maze();
            Players players = new Players();
            string winner = new GoldHuntGame(maze, players).InitWith(userInput).Start();

            //Then
            Assert.AreEqual("2", winner);
        }
예제 #3
0
 public GoldHuntGame(Maze maze, Players players)
 {
     Maze = maze;
     Players = players;
 }
예제 #4
0
 public void Setup()
 {
     stubMaze = MockRepository.GenerateStub<Maze>();
     stubPlayers = MockRepository.GenerateStub<Players>();
 }