public void AggregatePokerOdds_WHERE_single_item_supplied_SHOULD_throw_error() { //act + assert var actualException = Assert.Throws <ArgumentException>(() => PokerOdds.AggregatePokerOdds(new List <PokerOdds> { new PokerOdds() })); Assert.That(actualException.Message, Is.EqualTo("Cannot aggregate less than two PokerOdds")); }
public void Constructor() { //act var actual = new PokerOdds(); //assert //todo think these should all be set to an empty value, not null Assert.That(actual.WinPercentageWithError, Is.Null); Assert.That(actual.DrawPercentageWithError, Is.Null); Assert.That(actual.LossPercentageWithError, Is.Null); Assert.That(actual.PokerHandPercentagesWithErrors, Is.Null); }
private void DisplayPokerOdds(PokerOdds pokerOdds, Stopwatch stopwatch) { Console.WriteLine(); Console.WriteLine($"Results (calculated in {stopwatch.ElapsedMilliseconds}ms):"); Console.WriteLine($"Win : {pokerOdds.WinPercentageWithError}"); Console.WriteLine($"Draw : {pokerOdds.DrawPercentageWithError}"); Console.WriteLine($"Loss : {pokerOdds.LossPercentageWithError}"); Console.WriteLine(); Console.WriteLine("Hand Odds:"); foreach (var pokerHandOdds in pokerOdds.PokerHandPercentagesWithErrors.OrderByDescending(x => x.Key)) { Console.WriteLine($"{pokerHandOdds.Key} : {pokerHandOdds.Value}"); } }