public void IsFlush_NotFlush_False() { SolverPrototype solver = new SolverPrototype("Deck1"); HandFourOfAKind_Stub stub = new HandFourOfAKind_Stub(); bool expected = false; bool actual = solver.IsFlush(stub); Assert.That(actual, Is.EqualTo(expected)); }
public void IsTwoPairs_OnePair_True() { SolverPrototype solver = new SolverPrototype("Deck1"); HandOnePairs_Stub hand = new HandOnePairs_Stub(); bool expected = true; bool actual = solver.IsPair(hand); Assert.That(actual, Is.EqualTo(expected)); }
public void IsFourOfAKind_FourOfAKind_true() { SolverPrototype solver = new SolverPrototype("Deck1"); HandFourOfAKind_Stub stub = new HandFourOfAKind_Stub(); bool expected = true; bool actual = solver.IsFourOfAKind(stub); Assert.That(actual, Is.EqualTo(expected)); }
public void IsFlush_Flush_True() { SolverPrototype solver = new SolverPrototype("Deck1"); HandFlush_Stub stub = new HandFlush_Stub(); bool expected = true; bool actual = solver.IsFlush(stub); Assert.That(actual, Is.EqualTo(expected)); }
public static void TestMain2() { List<int> handTypeCounts = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0 }; SolverPrototype solver = new SolverPrototype("Deck1"); Console.WriteLine("Player 1 hand: {0}, Highest ranked: {1}", solver.Player1Hand.PokerHand.ToString(), solver.Player1Hand.PokerHandRanks[0].ToString()); Console.WriteLine("Player 2 hand: {0}, Highest ranked: {1}", solver.Player2Hand.PokerHand.ToString(), solver.Player2Hand.PokerHandRanks[0].ToString()); Console.WriteLine("Player " + (solver.Evaluate() + 1) + " has won!"); for (int i = 0; i < 1000; i++) { while (solver.Deck.Cards.Count >= 8) { Console.WriteLine("--------"); Console.WriteLine("New Game"); solver.Player1Hand.DrawNewHand(solver.Deck); solver.Player2Hand.DrawNewHand(solver.Deck); Console.WriteLine("Player 1 hand: {0}, Highest ranked: {1}", solver.Player1Hand.PokerHand.ToString(), solver.Player1Hand.PokerHandRanks[0].ToString()); handTypeCounts[(int)solver.Player1Hand.PokerHand] += 1; Console.WriteLine("Player 2 hand: {0}, Highest ranked: {1}", solver.Player2Hand.PokerHand.ToString(), solver.Player2Hand.PokerHandRanks[0].ToString()); handTypeCounts[(int)solver.Player1Hand.PokerHand] += 1; Console.WriteLine("Player " + (solver.Evaluate() + 1) + " has won!"); } solver.Deck.ReshuffleDeck(); Console.WriteLine("Reshuffled deck"); } Console.WriteLine("----------Total Hand counts--------------"); Console.WriteLine("Striaght Flush: {0}, Four of a kind: {1}, Fullhouse: {2}, Flush: {3}, Straight: {4}, Two Pair: {5}, Pair: {6}, High: {7}", handTypeCounts[7], handTypeCounts[6], handTypeCounts[5], handTypeCounts[4], handTypeCounts[3], handTypeCounts[2], handTypeCounts[1], handTypeCounts[0]); }
public SolverPrototypeService(SolverPrototype solver) { }
public void IsTwoPairs_TwoPairs_True() { SolverPrototype solver = new SolverPrototype("Deck1"); HandTwoPairs_Stub hand = new HandTwoPairs_Stub(); bool expected = true; bool actual = solver.IsTwoPairs(hand); Assert.That(actual, Is.EqualTo(expected)); }
public void IsFullHouse_FullHouse_True() { SolverPrototype solver = new SolverPrototype("Deck1"); HandFullHouse_Stub stub = new HandFullHouse_Stub(); bool expected = true; bool actual = solver.IsFullHouse(stub); Assert.That(actual, Is.EqualTo(expected)); }