public void CreateStraightFlush() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Straight Flush"; var testPokHand = CreateTestPokerHand("Phil Hellmuth1", "AH", "KH", "10H", "JH", "QH"); 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 CreateFlush2() { var testHandCalc = new HandTypeCalculator(); string expectedType = "Flush"; var testPokHand = CreateTestPokerHand("Tony G", "AC", "4C", "10C", "QC", "2C"); var pokerHandReturned = testHandCalc.GetHandType(testPokHand); Assert.Equal(expectedType, pokerHandReturned.Name); }
/// <summary> /// Saves the poker hand to the db. /// </summary> /// <param name="pokerHandDto">The poker hand dto that will be saved.</param> /// <returns>The poker hand dto that was saved.</returns> public PokerHandDto AddPokerHand(PokerHandForCreationDto pokerHandDto) { var pokerHandToAdd = _mapper.Map <PokerHand>(pokerHandDto); //Add call to determine card type pokerHandToAdd.Type = _handTypeCalculator.GetHandType(pokerHandToAdd).Name; _pokerHandsRepository.AddPokerHand(pokerHandToAdd); var pokerDtoToReturn = _mapper.Map <PokerHandDto>(pokerHandToAdd); return(pokerDtoToReturn); }
public void NotAllowNullPokerHand() { HandTypeCalculator sut = new HandTypeCalculator(); Assert.Throws <ArgumentNullException>("hand", () => sut.GetHandType(null)); }