示例#1
0
        public void second_player_does_not_have_to_post_blind()
        {
            var hero = new FakePlayer();
            var hand = new Hand(new FakePlayer(), hero, new FakeDeck("A", "2"));

            Assert.That(hero.PostedBlind, Is.EqualTo(false));
        }
示例#2
0
        public void prompts_first_player_to_post_blind()
        {
            var hero = new FakePlayer();
            var hand = new Hand(hero, new FakePlayer(), new FakeDeck("A", "2"));

            Assert.That(hero.PostedBlind, Is.EqualTo(true));
        }
示例#3
0
        public void deals_second_card_to_second_player()
        {
            var hero = new FakePlayer();
            var hand = new Hand(new FakePlayer(), hero, new FakeDeck("A", "2"));

            Assert.That(hero.ReceivedCard, Is.EqualTo("2"));
        }
        public void told_that_the_opponent_folded()
        {
            var hero = new FakePlayer();
            var hand = new Hand(hero, new AlwaysFolds(), new FakeDeck("A", "2"));

            Assert.That(hero.ReceivedOpponentsAction, Is.EqualTo("FOLD"));
        }
        public void receives_one_chip_for_winning()
        {
            var hero = new FakePlayer();
            var hand = new Hand(hero, new AlwaysFolds(), new FakeDeck("A", "2"));

            Assert.That(hero.ReceivedChipAmount, Is.EqualTo(1));
        }
示例#6
0
        public void hero_gets_chips()
        {
            var hero = new FakePlayer();
            var villain = new FakePlayer();
            villain.Will("CALL", "FOLD");
            hero.Will("BET");

            var hand = new Hand(hero, villain, new FakeDeck("A", "2"));

            Assert.That(hero.ReceivedChipAmount, Is.EqualTo(3));
        }
        public void villain_gets_chips_with_best_card()
        {
            var hero = new FakePlayer();
            var villain = new FakePlayer();
            villain.Will("CALL");
            hero.Will("CALL");

            var hand = new Hand(hero, villain, new FakeDeck("2", "A"));

            Assert.That(villain.ReceivedChipAmount, Is.EqualTo(2));
        }
示例#8
0
        public void villain_loses_2_chips()
        {
            var hero = new FakePlayer();
            var villain = new FakePlayer();

            villain.Will("BET", "FOLD");
            hero.Will("BET");

            var hand = new Hand(hero, villain, new FakeDeck("A", "2"));

            Assert.That(villain.TotalLostChips, Is.EqualTo(2));
        }
示例#9
0
        public void something()
        {
            var hero = new FakePlayer("Hero");
            var villain = new FakePlayer("Villain");

            villain.Will("CALL", "CALL", "CALL", "CALL");
            hero.Will("BET", "BET", "BET", "BET");

            var game = new OneCardPokerGame(hero, villain, 2, new FakeHandFactory(() => new FakeDeck("2", "A")));

            game.Play();

            game.ReportWinner(this);

            Assert.That(_winnerName, Is.EqualTo("Villain"));
        }
示例#10
0
        public void players_are_sent_the_starting_amount()
        {
            var p1 = new FakePlayer();
            var p2 = new FakePlayer();
            var game = new OneCardPokerGame(p1, p2, 10, this);

            Assert.That(p1.StartingChips, Is.EqualTo(10));
            Assert.That(p2.StartingChips, Is.EqualTo(10));
        }