Exemple #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
     });
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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);
        }
Exemple #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);
        }