Exemple #1
0
        public void Store_updates_all_supported_historical_periods()
        {
            var store = new VariableHistoryIntervalStore <int>();

            var entries = EntriesBuilder.Build(new Dictionary <DateTime, long>
            {
                { now, 5L }
            });

            store.Store(0, entries);

            foreach (var period in HistoryPeriod.All)
            {
                var reportDelay = TimeSpan.FromTicks(period.IntervalSize.Ticks * period.DelayedIntervals);

                var intervals = store.GetIntervals(period, now.Add(reportDelay));

                Assert.AreEqual(1, intervals.Length);
                Assert.AreEqual(5L, intervals[0].TotalValue);
                Assert.AreEqual(1L, intervals[0].TotalMeasurements);
            }
        }
 IntervalsStore <EndpointMessageType> .IntervalsBreakdown[] IProvideBreakdownBy <EndpointMessageType> .GetIntervals(HistoryPeriod period, DateTime now)
 {
     return(byMessageType.GetIntervals(period, now));
 }
 public IntervalsStore <EndpointInstanceId> .IntervalsBreakdown[] GetIntervals(HistoryPeriod period, DateTime now)
 {
     return(byInstance.GetIntervals(period, now));
 }