public void HandOfCards_ConvertsStringToListOfPlayingCard() { var hand = "2C TD 3S 7H AC"; var expected = new List <PlayingCard> { new PlayingCard('2', 'C'), new PlayingCard('3', 'S'), new PlayingCard('7', 'H'), new PlayingCard('T', 'D'), new PlayingCard('A', 'C') }.OrderByDescending(o => o.CardValue).ToList(); var result = new HandOfCards(hand).Cards; Assert.AreEqual(5, result.Count); Assert.AreEqual(expected[0].CardValue, result[0].CardValue); Assert.AreEqual(expected[0].CardSuit, result[0].CardSuit); Assert.AreEqual(expected[1].CardValue, result[1].CardValue); Assert.AreEqual(expected[1].CardSuit, result[1].CardSuit); Assert.AreEqual(expected[2].CardValue, result[2].CardValue); Assert.AreEqual(expected[2].CardSuit, result[2].CardSuit); Assert.AreEqual(expected[3].CardValue, result[3].CardValue); Assert.AreEqual(expected[3].CardSuit, result[3].CardSuit); Assert.AreEqual(expected[4].CardValue, result[4].CardValue); Assert.AreEqual(expected[4].CardSuit, result[4].CardSuit); }
public void Test1() { HandOfCards hoc = new HandOfCards(new int[] { }); int res = hoc.PopTop(); Assert.AreEqual(-1, res); }
public void Test5() { HandOfCards hoc = new HandOfCards(new int[] { 9, 8, 7 }); hoc.AddToBottom(987); int res = hoc.PopTop(); Assert.AreEqual(9, res); }
public void Start() { hand = GetComponent <HandOfCards>(); hand.player = this; hand.cam = cam; hand.gridM = gridM; health = 20; connection = 10; aether = 5; }
public void Test3() { HandOfCards hoc = new HandOfCards(new int[] { 9, 8, 7 }); int res1 = hoc.PopTop(); int res2 = hoc.PopTop(); int res3 = hoc.PopTop(); int res4 = hoc.PopTop(); Assert.AreEqual(9, res1); Assert.AreEqual(8, res2); Assert.AreEqual(7, res3); Assert.AreEqual(-1, res4); }
public void Test4() { HandOfCards hoc = new HandOfCards(new int[] { 9, 8, 7 }); int c = hoc.Count; Assert.AreEqual(3, c); hoc.AddToBottom(11); c = hoc.Count; Assert.AreEqual(4, c); hoc.PopTop(); hoc.PopTop(); Assert.AreEqual(2, hoc.Count); hoc.PopTop(); hoc.PopTop(); Assert.AreEqual(0, hoc.Count); }
public PokerPlayer(string name, string hand) { Name = name; HandOfCards = new HandOfCards(hand); }
// Start is called before the first frame update void Start() { _handOfCards = handOfCards.GetComponent <HandOfCards>(); _handOfCards.initializeHand(handSize); }
public void HandOfCards_SetsPokerHandRank(string hand, PokerHandRank expectedPokerHandRank) { var handOfCards = new HandOfCards(hand); Assert.AreEqual(expectedPokerHandRank, handOfCards.PokerHandRank); }