Пример #1
0
 public void ConstructorShouldThrowArgumentOutOfRangeExceptionWhenInitialMoneyAreZero()
 {
     Mock <IPlayer> mockedSecondPlayer = new Mock <IPlayer>();
     Mock <IPlayer> mockedFirstPlayer  = new Mock <IPlayer>();
     var            initialMoney       = 0;
     var            twoPlayersGame     = new TwoPlayersTexasHoldemGame(mockedFirstPlayer.Object, mockedSecondPlayer.Object, initialMoney);
 }
Пример #2
0
 public void ConstructorShouldThrowArgumentNullExceptionWhenIncorrectSecondPlayer()
 {
     IPlayer        secondPlayer      = null;
     Mock <IPlayer> mockedFirstPlayer = new Mock <IPlayer>();
     var            initialMoney      = 1000;
     var            twoPlayersGame    = new TwoPlayersTexasHoldemGame(mockedFirstPlayer.Object, secondPlayer, initialMoney);
 }
Пример #3
0
        //[ExpectedException(typeof(ArgumentNullException))]
        public void ConstructorShouldThrowArgumentNullExceptionWhenIncorrectFirstPlayer()
        {
            IPlayer        firstPlayer        = null;
            Mock <IPlayer> mockedSecondPlayer = new Mock <IPlayer>();
            var            initialMoney       = 1000;
            var            twoPlayersGame     = new TwoPlayersTexasHoldemGame(firstPlayer, mockedSecondPlayer.Object, initialMoney);

            Assert.Throws <ArgumentNullException>(() => new TwoPlayersTexasHoldemGame(firstPlayer, mockedSecondPlayer.Object, initialMoney));
        }
Пример #4
0
        public void ConstructorShouldThrowArgumentExceptionWhenTwoPlayersHaveEqualNames()
        {
            Mock <IPlayer> mockedFirstPlayer  = new Mock <IPlayer>();
            Mock <IPlayer> mockedSecondPlayer = new Mock <IPlayer>();

            mockedSecondPlayer.SetupGet(x => x.Name).Returns("Player");
            mockedFirstPlayer.SetupGet(x => x.Name).Returns("Player");
            var initialMoney   = 1000;
            var twoPlayersGame = new TwoPlayersTexasHoldemGame(mockedFirstPlayer.Object, mockedSecondPlayer.Object, initialMoney);
        }
Пример #5
0
        public static void Main()
        {
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.BufferHeight = Console.WindowHeight = GameHeight;
            Console.BufferWidth = Console.WindowWidth = GameWidth;

            ConsoleHelper.WriteOnConsole(GameHeight - 1, GameWidth - ProgramName.Length - 1, ProgramName, ConsoleColor.Green);

            var consolePlayer1 = new ConsoleUiDecorator(new ConsolePlayer(0), 0, GameWidth, 5);
            var consolePlayer2 = new ConsoleUiDecorator(new Bluffasaurus(), 6, GameWidth, 5);
            ITexasHoldemGame game = new TwoPlayersTexasHoldemGame(consolePlayer1, consolePlayer2);
            game.Start();
        }
Пример #6
0
        public static void Main()
        {
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.BufferHeight    = Console.WindowHeight = GameHeight;
            Console.BufferWidth     = Console.WindowWidth = GameWidth;

            ConsoleHelper.WriteOnConsole(GameHeight - 1, GameWidth - ProgramName.Length - 1, ProgramName, ConsoleColor.Green);

            var consolePlayer1    = new ConsoleUiDecorator(new ConsolePlayer(0), 0, GameWidth, 5);
            var consolePlayer2    = new ConsoleUiDecorator(new SmartPlayer(), 6, GameWidth, 5);
            ITexasHoldemGame game = new TwoPlayersTexasHoldemGame(consolePlayer1, consolePlayer2);

            game.Start();
        }