Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            GameInteraction gi = new GameInteraction(new ConsoleIOController());

            gi.StartInteractiveLudoGame();
            gi.ChooseMenuOption();

            Console.WriteLine("Game over!! Press any key!");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public void LoadUnifinishedGame()
        {
            //As a ludo-player, I want to be able to load an unfinished game, to continue playing that game.

            //Arrange
            var gameIo = new ListIOController();

            gameIo.Actions = new List <object>()
            {
                0, 2, "MyFirstPlayer", "Red", "MySecondPlayer", "Green"
            };
            GameInteraction gi = new GameInteraction(gameIo);

            gi.StartInteractiveLudoGame();
            gi.ChooseMenuOption();
        }
Exemplo n.º 3
0
        public void PossibleToSetNameAndColor()
        {
            //As a ludo-player I want to set my name and color when joining a new game
            var gameIo = new ListIOController();

            gameIo.Actions = new List <object>()
            {
                2, "Andre", "Red", "Morad", "Blue"
            };
            GameInteraction gi = new GameInteraction(gameIo);

            gi.ChooseMenuOption();

            Assert.Equal("Andre", gi.players[0].PlayerName);
            Assert.Equal("Red", gi.players[0].Color);
        }
Exemplo n.º 4
0
        public void ShowGameHistory()
        {
            //As a ludo-player, I want to be able look at game-history, to see past games.
            //Arrange
            var             gameIo = new ListIOController();
            GameInteraction gi     = new GameInteraction(gameIo);

            //Act
            gameIo.Actions = new List <object>()
            {
                0, 2, "MyFirstPlayer", "Red", "MySecondPlayer", "Green"
            };
            gi.StartInteractiveLudoGame();
            gi.ChooseMenuOption();
            gi.ShowGameHistory();

            //Assert
            Assert.StartsWith("Showing your game history from with ID: ", gameIo.Messages[13]);
        }
Exemplo n.º 5
0
        public void CanStartNewGameWithTwoPlayers()
        {
            //Arrange
            var gameIo = new ListIOController();

            gameIo.Actions = new List <object>()
            {
                0, 2, "MyFirstPlayer", "Red", "MySecondPlayer", "Green"
            };
            GameInteraction gi = new GameInteraction(gameIo);

            //Act
            gi.StartInteractiveLudoGame();
            gi.ChooseMenuOption();

            //Assert
            Assert.StartsWith("Your new game have ID:", gameIo.Messages[12]);

            //As a ludo-player I want to be able to start a new ludo game where all peices are at the inital positons
        }