public void AceAsOne() { var hand1 = new Straight(); hand1.SetCards(Cards.New() .Ace(Suit.Clubs) .Two(Suit.Clubs) .Three(Suit.Diamonds) .Four(Suit.Diamonds) .Five(Suit.Hearts) .Nine(Suit.Spades) .Ten(Suit.Spades)); var hand2 = new Straight(); hand2.SetCards(Cards.New() .Two(Suit.Clubs) .Three(Suit.Diamonds) .Four(Suit.Diamonds) .Five(Suit.Hearts) .Six(Suit.Hearts) .Nine(Suit.Spades) .Jack(Suit.Spades)); Assert.IsTrue(hand1.IsPresent()); Assert.IsTrue(hand2.IsPresent()); Assert.Less(hand1, hand2); }
public void streight_handCards_3() { var set = new Straight(); var cards = new List <Card> { new Card(Suit.Clubs, Rank.Six), new Card(Suit.Diamonds, Rank.Two), new Card(Suit.Spades, Rank.Three), new Card(Suit.Hearts, Rank.Five), new Card(Suit.Spades, Rank.Four), new Card(Suit.Spades, Rank.Queen), new Card(Suit.Clubs, Rank.Seven) }; set.SetCards(cards); var result = set.IsPresent(); var handCards = set.HandCards.OrderBy(x => x.Rank.Score).ToList(); Assert.True(result); handCards[0].AssertRank(Rank.Three); handCards[1].AssertRank(Rank.Four); handCards[2].AssertRank(Rank.Five); handCards[3].AssertRank(Rank.Six); handCards[4].AssertRank(Rank.Seven); }
public void straight_no_3() { var set = new Straight(); var cards = new List <Card> { new Card(Suit.Clubs, Rank.King), new Card(Suit.Diamonds, Rank.Jack), new Card(Suit.Spades, Rank.Ace), new Card(Suit.Clubs, Rank.Four), new Card(Suit.Diamonds, Rank.Five), new Card(Suit.Clubs, Rank.Six), new Card(Suit.Diamonds, Rank.Seven) }; set.SetCards(cards); var result = set.IsPresent(); Assert.IsFalse(result); }
public void straight_no() { var set = new Straight(); var cards = new List <Card> { new Card(Suit.Diamonds, Rank.Two), new Card(Suit.Hearts, Rank.Three), new Card(Suit.Clubs, Rank.Ace), new Card(Suit.Clubs, Rank.Seven), new Card(Suit.Clubs, Rank.King), new Card(Suit.Clubs, Rank.Ten), new Card(Suit.Spades, Rank.Seven) }; set.SetCards(cards); var result = set.IsPresent(); Assert.IsFalse(result); }
public void straight_yes_3() { var set = new Straight(); var cards = new List <Card> { new Card(Suit.Clubs, Rank.Three), new Card(Suit.Diamonds, Rank.Two), new Card(Suit.Spades, Rank.Ace), new Card(Suit.Clubs, Rank.King), new Card(Suit.Diamonds, Rank.Queen), new Card(Suit.Clubs, Rank.Jack), new Card(Suit.Diamonds, Rank.Ten) }; set.SetCards(cards); var result = set.IsPresent(); var highCard = set.HandCards.OrderByDescending(x => x.Rank).First(); Assert.IsTrue(result); Assert.AreEqual(Rank.Ace.Score, highCard.Rank.Score); }
public void straight_yes_6() { var set = new Straight(); var cards = new List <Card> { new Card(Suit.Clubs, Rank.Eight), new Card(Suit.Diamonds, Rank.Nine), new Card(Suit.Spades, Rank.Ace), new Card(Suit.Clubs, Rank.Four), new Card(Suit.Diamonds, Rank.Five), new Card(Suit.Clubs, Rank.Six), new Card(Suit.Diamonds, Rank.Seven) }; set.SetCards(cards); var result = set.IsPresent(); var highCard = set.HandCards.OrderByDescending(x => x.Rank).First(); Assert.IsTrue(result); Assert.AreEqual(Rank.Nine.Score, highCard.Rank.Score); }