Compare() public method

public Compare ( Hand black, Hand white ) : Hand
black Hand
white Hand
return Hand
Beispiel #1
0
        public void CompareFlushWinsOverHighCard()
        {
            var white = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Three, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Five, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Nine, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.King, Card.CardSuit.Diamonds));

            var black = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Three, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Five, Card.CardSuit.Spades),
                new Card(Card.CardValue.Nine, Card.CardSuit.Clubs),
                new Card(Card.CardValue.King, Card.CardSuit.Hearts));

            var checker = new HandChecker();

            var result = checker.Compare(black, white);

            Assert.AreEqual(white, result);
        }
        public void CompareFlushWinsOverPair()
        {
            var black = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Three, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Five, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Nine, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.King, Card.CardSuit.Diamonds));

            var white = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Three, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Three, Card.CardSuit.Spades),
                new Card(Card.CardValue.Nine, Card.CardSuit.Clubs),
                new Card(Card.CardValue.King, Card.CardSuit.Hearts));

            var checker = new HandChecker();

            var result = checker.Compare(black, white);

            Assert.AreEqual(black, result);
        }
Beispiel #3
0
        public void CompareHandsOtherWayAround()
        {
            var white = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Three, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Five, Card.CardSuit.Spades),
                new Card(Card.CardValue.Nine, Card.CardSuit.Clubs),
                new Card(Card.CardValue.King, Card.CardSuit.Diamonds));

            var black = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Three, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Four, Card.CardSuit.Spades),
                new Card(Card.CardValue.Eight, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Ace, Card.CardSuit.Hearts));

            var checker = new HandChecker();

            var result = checker.Compare(black, white);

            Assert.AreEqual(black, result);
        }
        public void CompareHandsOtherWayAround()
        {
            var white = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Three, Card.CardSuit.Diamonds),
                new Card(Card.CardValue.Five, Card.CardSuit.Spades),
                new Card(Card.CardValue.Nine, Card.CardSuit.Clubs),
                new Card(Card.CardValue.King, Card.CardSuit.Diamonds));

            var black = new Hand(
                new Card(Card.CardValue.Two, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Three, Card.CardSuit.Hearts),
                new Card(Card.CardValue.Four, Card.CardSuit.Spades),
                new Card(Card.CardValue.Eight, Card.CardSuit.Clubs),
                new Card(Card.CardValue.Ace, Card.CardSuit.Hearts));

            var checker = new HandChecker();

            var result = checker.Compare(black, white);

            Assert.AreEqual(black, result);
        }