Пример #1
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);
        }
Пример #2
0
 public void ItGeneratesMazeWithUserInput()
 {
     //Given
     var mazeInput = new List<string> { "2 3", "D 2 0 D -1 0 T", "G D 6 0 D 0 3" };
     //When
     var board = new Maze().InitWith(mazeInput).Board;
     //Then
     Assert.AreEqual(2 * 3, board.Length);
     Assert.AreEqual(typeof(DisplacementCell), board[0, 0].GetType());
     Assert.AreEqual(typeof(DisplacementCell), board[0, 1].GetType());
     Assert.AreEqual(typeof(TrapCell), board[0, 2].GetType());
     Assert.AreEqual(typeof(GoldCell), board[1, 0].GetType());
     Assert.AreEqual(typeof(DisplacementCell), board[1, 1].GetType());
     Assert.AreEqual(typeof(DisplacementCell), board[1, 2].GetType());
 }
Пример #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>();
 }