public void CountOfTest1() { PokerHand target = new PokerHand(new Card(Suit.SPADES, Rank.ACE)); Rank rank = Rank.EIGHT; int expected = 0; int actual; actual = target.CountOf(rank); Assert.AreEqual(expected, actual); rank = Rank.ACE; expected = 1; actual = target.CountOf(rank); Assert.AreEqual(expected, actual); target.InsertCard(new Card(Suit.HEARTS, Rank.ACE)); expected = 2; actual = target.CountOf(rank); Assert.AreEqual(expected, actual); target.RemoveCard(new Card(Suit.SPADES, Rank.ACE)); expected = 1; actual = target.CountOf(rank); Assert.AreEqual(expected, actual); }
public void CountOfTest() { PokerHand target = new PokerHand(new Card(Suit.SPADES, Rank.ACE)); Suit suit = Suit.HEARTS; int expected = 0; int actual; actual = target.CountOf(suit); Assert.AreEqual(expected, actual); suit = Suit.SPADES; expected = 1; actual = target.CountOf(suit); Assert.AreEqual(expected, actual); target.InsertCard(new Card(Suit.SPADES, Rank.QUEEN)); expected = 2; actual = target.CountOf(suit); Assert.AreEqual(expected, actual); target.RemoveCard(new Card(Suit.SPADES, Rank.ACE)); expected = 1; actual = target.CountOf(suit); Assert.AreEqual(expected, actual); }
public void InsertCardTest() { PokerHand target = new PokerHand(new Card(Suit.SPADES, Rank.ACE)); Card card = new Card(Suit.SPADES, Rank.ACE); target.InsertCard(card); Assert.AreEqual(true, target.Contains(new Card(Suit.SPADES, Rank.ACE))); Assert.AreEqual(false, target.Contains(new Card(Suit.CLUBS, Rank.ACE))); Assert.AreEqual(2, target.CountOf(new Card(Suit.SPADES, Rank.ACE))); }