public void CreateFlush() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Flush"; var testPokHand = CreateTestPokerHand("Tony G", "AH", "4H", "8H", "3H", "2H"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
/// <summary> /// Initializes a new instance of the <see cref="PokerHandsService"/> class. /// </summary> /// <param name="pokerHandsRepository">The poker hands repository.</param> /// <param name="mapper">The mapper.</param> /// <exception cref="ArgumentNullException">pokerHandsRepository</exception> /// <exception cref="ArgumentNullException">mapper</exception> public PokerHandsService(IPokerHandsRepository pokerHandsRepository, IMapper mapper) { _pokerHandsRepository = pokerHandsRepository ?? throw new ArgumentNullException(nameof(pokerHandsRepository)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _handTypeCalculator = new HandTypeCalculator(); _handComparer = new HandComparer(); }
public void CreateFullHouse() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Full House"; var testPokHand = CreateTestPokerHand("Phil Hellmuth", "AH", "AS", "AD", "6C", "6H"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateFullHouse2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Full House"; var testPokHand = CreateTestPokerHand("Tony G", "4H", "2S", "4D", "4C", "2H"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateStraightFlush2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Straight Flush"; var testPokHand = CreateTestPokerHand("Phil Hellmuth1", "2H", "6H", "3H", "4H", "5H"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateFourOfAKind2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Four of a Kind"; var testPokHand = CreateTestPokerHand("Phil Hellmuth", "4H", "4S", "AD", "4C", "4D"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateHighCard() { var testHandCalc = new HandTypeCalculator(); string expectedType = "High Card"; var testPokHand = CreateTestPokerHand("Toby Maguire", "AS", "KH", "6C", "3H", "JC"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateHighCard2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "High Card"; var testPokHand = CreateTestPokerHand("Daniel Negreanu", "2D", "7H", "6S", "10D", "4C"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateTwoPair2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Two Pair"; var testPokHand = CreateTestPokerHand("Daniel Negreanu", "2D", "2H", "6S", "6D", "3D"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateTrips2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Three of a Kind"; var testPokHand = CreateTestPokerHand("Toby Maguire", "2D", "6H", "6S", "6D", "3D"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void CreateStraight2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Straight"; var testPokHand = CreateTestPokerHand("Toby Maguire", "2H", "6D", "3S", "4H", "5C"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
public void ThenCorrectHandTypeReturned(string[] input, HandType expectedHandType) { var cards = new List <Card>(); for (int i = 0; i < input.Length; i++) { string cardValue = input[i]; var card = CardFactory.CreateCard(cardValue); cards.Add(card); } var handType = HandTypeCalculator.GetHandTypeFromCards(cards); Assert.AreEqual(expectedHandType, handType); }
public void NotAllowNullPokerHand() { HandTypeCalculator sut = new HandTypeCalculator(); Assert.Throws <ArgumentNullException>("hand", () => sut.GetHandType(null)); }
public void CreateHandTypeCalculator() { HandTypeCalculator sut = new HandTypeCalculator(); Assert.IsType <HandTypeCalculator>(sut); }