Exemple #1
0
        public void Clone_HandHistoryHandWithThreePlayers_ShouldReturnExactHand()
        {
            HandHistory script = new HandHistory();

            var mock = new Mock<OmahaPlayer>();
            mock.Setup(p => p.Act()).Returns(PokerAction.CreateCallAction());

            script.ButtonSeat = 0;
            script.SmallBlindSeat = 1;
            script.SmallBlindAmount = 5;
            script.BigBlindSeat = 2;
            script.BigBlindAmount = 10;

            script.Players[0] = new HandHistoryPlayer("Bob", 2300);
            script.Players[1] = new HandHistoryPlayer("Kevin", 2800);
            script.Players[2] = new HandHistoryPlayer("Burger", 2800);

            script.Players[0].HoleCards = new Card[] { new Card("5s"), new Card("Js"), new Card("7h"), new Card("Qs") };
            script.Players[1].HoleCards = new Card[] { new Card("3s"), new Card("3d"), new Card("7d"), new Card("Ah") };
            script.Players[2].HoleCards = new Card[] { new Card("2s"), new Card("Jh"), new Card("3h"), new Card("Ad") };

            script.Actions.Add(new HandHistoryPokerAction(script.Players[0], PokerAction.CreateCallAction()));
            script.Actions.Add(new HandHistoryPokerAction(script.Players[1], PokerAction.CreateCallAction()));
            script.Actions.Add(new HandHistoryPokerAction(script.Players[2], PokerAction.CreateCallAction()));

            OmahaHiLoHand hand = new OmahaHiLoHand(script);
            OmahaHiLoHand cloned = (OmahaHiLoHand)hand.Clone();

            HandResult hr1 = hand.RunToEnd();
            HandResult hr2 = cloned.RunToEnd();

            // This isn't perfect, but for now this is fine
            Assert.AreEqual(hr1.Winners[0].Player.HoleCards, hr2.Winners[0].Player.HoleCards);
        }
Exemple #2
0
        public void Clone_SingleHandWithSeed_ShouldReturnExactHand()
        {
            OmahaHiLoHand hand = new OmahaHiLoHand();
            hand.Seed = 1;

            var mock1 = new Mock<OmahaPlayer>();
            mock1.Setup(p => p.Act()).Returns(PokerAction.CreateCallAction());

            var mock2 = new Mock<OmahaPlayer>();
            mock2.Setup(p => p.Act()).Returns(PokerAction.CreateCallAction());

            hand.Sit(mock1.Object, 3, 1000);
            hand.Sit(mock2.Object, 4, 1000);

            OmahaHiLoHand cloned = (OmahaHiLoHand)hand.Clone();

            HandResult hr1 = hand.RunToEnd();
            HandResult hr2 = cloned.RunToEnd();

            Assert.AreEqual(hr1.Winners[0].Player.HoleCards, hr2.Winners[0].Player.HoleCards);
        }