Ejemplo n.º 1
0
 public void Initialize()
 {
     best = new BestPossibleHand(HandName.Pair, new List <ICard> {
         TestData.DiamondKing, TestData.ClubKing
     },
                                 new List <CardValue> {
         CardValue.Ace, CardValue.Eight, CardValue.Three
     });
 }
Ejemplo n.º 2
0
        public void EqualWithDifferentHandReturnsFalse()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.HeartFour, TestData.SpadeFour
            },
                                             new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });

            Assert.IsFalse(best == other);
        }
Ejemplo n.º 3
0
        public void LessThanWithHigherHandReturnsTrue()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.ClubAce, TestData.HeartAce
            },
                                             new List <CardValue> {
                CardValue.King, CardValue.Eight, CardValue.Three
            });

            Assert.IsTrue(best < other);
        }
Ejemplo n.º 4
0
        public void LessThanWithLowerHandReturnsFalse()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.HeartFour, TestData.SpadeFour
            },
                                             new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });

            Assert.IsFalse(best < other);
        }
Ejemplo n.º 5
0
        public void DifferentHandsHandHaveDifferentSameHashCode()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.HeartFour, TestData.SpadeFour
            },
                                             new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });

            Assert.IsFalse(best.Equals((object)other));
        }
Ejemplo n.º 6
0
        public void EqualityWithSameHandAsObjectIsTrue()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.DiamondKing, TestData.ClubKing
            },
                                             new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });

            Assert.IsTrue(best.Equals((object)other));
        }
Ejemplo n.º 7
0
        public void NotEqualWithSameHandReturnsFalse()
        {
            var other = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.DiamondKing, TestData.ClubKing
            },
                                             new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });

            Assert.IsFalse(best != other);
        }
Ejemplo n.º 8
0
        public void SameHandsHaveSameHashCode()
        {
            var expected = best.GetHashCode();
            var other    = new BestPossibleHand(HandName.Pair, new List <ICard> {
                TestData.DiamondKing, TestData.ClubKing
            },
                                                new List <CardValue> {
                CardValue.Ace, CardValue.Eight, CardValue.Three
            });
            var actual = other.GetHashCode();

            Assert.AreEqual(expected, actual);
        }