public void MakeGoodOne() { var board = new Board(); var hands = board.Hands; var myHand = hands[Seat.South]; var otherHands = hands.OtherHands(Seat.South); new Deck() .Shuffle() .Deal(hands); var fact = new SuitLength(6, Suit.Spades); Assert.IsTrue(fact.MakeGood(myHand, otherHands)); Assert.AreEqual(6, myHand.SuitLength(Suit.Spades)); Console.WriteLine(board); new Deck() .Shuffle() .Deal(hands); fact = new SuitLength(10, 13, Suit.Clubs); Assert.IsTrue(fact.MakeGood(myHand, otherHands)); Console.WriteLine(board); int l = myHand.SuitLength(Suit.Clubs); Assert.IsTrue(10 <= l && l <= 13); new Deck() .Shuffle() .Deal(hands); fact = new SuitLength(14, Suit.Clubs); Assert.IsFalse(fact.MakeGood(myHand, otherHands)); }
public void Stringing() { var fact = new SuitLength(2, Suit.Clubs); Assert.AreEqual("SuitLength(2, Clubs)", fact.ToString()); fact = new SuitLength(2, 4, Suit.Clubs); Assert.AreEqual("SuitLength(2, 4, Clubs)", fact.ToString()); }
public void Constructors() { var fact = new SuitLength(2, Suit.Clubs); Assert.AreEqual(2, fact.Minimum); Assert.AreEqual(2, fact.Maximum); Assert.AreEqual(Suit.Clubs, fact.Suit); fact = new SuitLength(2, 4, Suit.Clubs); Assert.AreEqual(2, fact.Minimum); Assert.AreEqual(4, fact.Maximum); Assert.AreEqual(Suit.Clubs, fact.Suit); }