public void grouping_by_2_should_produce_two_results()
        {
            var aggregator = new MeasurementAggregator2(_data);
            var result     = aggregator.Aggregate(new SizeGrouper(2),
                                                  new AveragingCalculator());

            Assert.AreEqual(2, result.Count());
        }
        public void mode_should_calculate_average_high_and_low_values()
        {
            var aggregator = new MeasurementAggregator2(_data);
            var result     = aggregator.Aggregate(new SizeGrouper(4),
                                                  new ModalCalculator());

            var first = result.ElementAt(0);

            Assert.AreEqual(10.0, first.HighValue, 0.005);
            Assert.AreEqual(1.0, first.LowValue, 0.005);
        }
        public void averaging_should_calculate_average_high_andlow_values()
        {
            var aggregator = new MeasurementAggregator2(_data);
            var result     = aggregator.Aggregate(new SizeGrouper(2),
                                                  new AveragingCalculator());

            var first = result.ElementAt(0);

            Assert.AreEqual(7.5, first.HighValue, 0.005);
            Assert.AreEqual(1.5, first.LowValue, 0.005);

            var second = result.ElementAt(1);

            Assert.AreEqual(6.0, second.HighValue, 0.005);
            Assert.AreEqual(2.5, second.LowValue, 0.005);
        }