public void Calculate_Any_ShouldNotCreateEmptyGroups() { var numbers = new[] { 10d }; var unitUnderTest = new FrequencyDistribution(10); var distribution = unitUnderTest.Calculate(numbers); Assert.AreEqual(1, distribution.Keys.Count); }
public void Calculate_MinusNumbers_ShouldApportionCorrectly() { var numbers = new[] { -10d }; var unitUnderTest = new FrequencyDistribution(10); var distribution = unitUnderTest.Calculate(numbers); Assert.AreEqual(1, distribution[new Tuple <double, double>(-10d, 0d)]); }
public void Calculate_MultipleOccurences_ShouldApportionCorrectly() { var numbers = new[] { 9.9, 0, 1 }; var unitUnderTest = new FrequencyDistribution(10); var distribution = unitUnderTest.Calculate(numbers); Assert.AreEqual(3, distribution[new Tuple <double, double>(0d, 10d)]); }
public void Calculate_HighDecimal_ShouldNotRoundUp() { var numbers = new[] { 9.9d }; var unitUnderTest = new FrequencyDistribution(10); var distribution = unitUnderTest.Calculate(numbers); Assert.AreEqual(1, distribution[new Tuple <double, double>(0d, 10d)]); }
public void Calculate_BandingOfTwo_ShouldApportionCorrectly() { var numbers = new[] { -1d, 0d, 1d, 2d, 3d }; var unitUnderTest = new FrequencyDistribution(2); var distribution = unitUnderTest.Calculate(numbers); Assert.AreEqual(1, distribution[new Tuple <double, double>(-2d, 0d)]); Assert.AreEqual(2, distribution[new Tuple <double, double>(0d, 2d)]); Assert.AreEqual(2, distribution[new Tuple <double, double>(2d, 4d)]); }