public void AggregateEmptyObservationsTest() { AverageBySecondDataPointAggregator target = new AverageBySecondDataPointAggregator(); IEnumerable<AggregatedDataPoint> result = target.Aggregate(ConsecutiveDataPointObservationsCollection.Empty); Assert.IsFalse(result.Any()); }
/// <summary> /// Creates a new instance of <see cref="AverageBySecondDataPointAggregator"/> and uses it to aggregate /// some mock data. /// </summary> /// <param name="observations"> /// The (UTC) dates to use for the mock observations. The amount of mock observations generated will be /// equal to the length of this array. /// </param> /// <returns>The results of the aggregation.</returns> private static IEnumerable<AggregatedDataPoint> DummyAggregation(params DataPointObservation[] observations) { IOrderedEnumerable<DataPointObservation> dummyObservations = observations.OrderBy(o => o.UtcTimestamp); const bool DoesntMatter = true; ConsecutiveDataPointObservationsCollection aggregationInput = new SampleConsecutiveDataPointObservationsCollection( observations: dummyObservations, aggregationReceiver: _ => Assert.Fail("ProvideCorrespondingAggregatedData should not be called"), isPartial: DoesntMatter); AverageBySecondDataPointAggregator target = new AverageBySecondDataPointAggregator(); return target.Aggregate(aggregationInput); }