public void CumulativeDistribution_GetCumulativeDistribution_WithWeightedValues_ReturnsDistributedValues() { var weightedValues = new Dictionary <int, double> { { 1, 2.5 }, { 45, 0.17 }, { 100, 43.12 } }; IDictionary <double, int> result = CumulativeDistribution.GetCumulativeDistribution <int>(weightedValues); Assert.That(result, Is.EquivalentTo(new Dictionary <double, int> { { 2.5, 1 }, { 2.67, 45 }, { 45.79, 100 } })); }
public void CumulativeDistribution_GetCumulativeDistribution_WithEmptyArgument_ReturnsEmptyResult() { IDictionary <double, int> result = CumulativeDistribution.GetCumulativeDistribution <int>(new Dictionary <int, double>()); Assert.That(result, Is.Empty); }
public void CumulativeDistribution_GetCumulativeDistribution_WithNullArgument_ThrowsArgumentNullException() { Assert.That(() => CumulativeDistribution.GetCumulativeDistribution <int>(null), Throws.ArgumentNullException); }