public void grouping_by_2_should_produce_two_results()
        {
            var aggregator = new MeasurementAggregator(_data);
            var result     = aggregator.Aggregate(2, AggregationType.Mean);

            Assert.AreEqual(2, result.Count());
        }
        public void grouping_by_2_should_produce_two_results()
        {
            var aggregator = new MeasurementAggregator(_data);
            var result     = aggregator.Aggregate(new SizeGroupingStrategy(2), new MeanAggregator());

            Assert.AreEqual(2, result.Count());
        }
        public void mode_should_calculate_average_high_and_low_values()
        {
            var aggregator = new MeasurementAggregator(_data);
            var result     = aggregator.Aggregate(4, AggregationType.Mode);

            var first = result.ElementAt(0);

            Assert.AreEqual(10.0, first.HighValue, 0.005);
            Assert.AreEqual(1.0, first.LowValue, 0.005);
        }
        public void mode_should_calculate_average_high_and_low_values()
        {
            var aggregator = new MeasurementAggregator(_data);
            var result     = aggregator.Aggregate(new SizeGroupingStrategy(4), new ModeAggregator());

            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 MeasurementAggregator(_data);
            var result     = aggregator.Aggregate(2, AggregationType.Mean);

            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);
        }
示例#6
0
 public MeasurementAggregatorTestShould(Mother mother)
 {
     // Arrange
     aggregator = new MeasurementAggregator(mother.Get4Measurements());
 }
 public When_aggregating_four_measurements()
 {
     _aggregator = new MeasurementAggregator(Mother.Get4Measurements());
 }