private static void AssertSane(Tuple <UniqueId, ILocalDateDoubleTimeSeries> result) { var uniqueIdentifier = result.Item1; ILocalDateDoubleTimeSeries series = result.Item2; Assert.NotNull(uniqueIdentifier); AssertSane(series); }
public void CanGetACompleteTimeSeries() { var timeSeriesSource = Context.HistoricalTimeSeriesSource; var end = DateTimeOffset.Now; ILocalDateDoubleTimeSeries series = timeSeriesSource.GetHistoricalTimeSeries(UniqueId.Create("DbHts", "3580")); AssertSane(series, end); }
public void CanGetATimeSeries() { var timeSeriesSource = Context.HistoricalTimeSeriesSource; var end = DateTimeOffset.Now - TimeSpan.FromDays(1); var start = end - TimeSpan.FromDays(14); ILocalDateDoubleTimeSeries series = timeSeriesSource.GetHistoricalTimeSeries(UniqueId.Create("DbHts", "3580"), start, false, end, false); AssertSane(series, start, end); }
private static void AssertSane(ILocalDateDoubleTimeSeries series, DateTimeOffset start, DateTimeOffset end) { Assert.NotNull(series); Assert.NotNull(series.DateTimeConverter); Assert.NotEmpty(series.Values); foreach (var value in series.Values) { Assert.InRange(value.Item1, start, end); } Assert.Equal(series.Values, series.Values.OrderBy(s => s.Item1).ToList()); }
public void CanGetATimeSeriesExclusive() { var timeSeriesSource = Context.HistoricalTimeSeriesSource; var end = DateTimeOffset.Now - TimeSpan.FromDays(1); var start = end - TimeSpan.FromDays(14); ILocalDateDoubleTimeSeries series = timeSeriesSource.GetHistoricalTimeSeries(UniqueId.Create("DbHts", "3580"), start, false, end, false); AssertSane(series, start, end); var lastIncluded = series.Values.Last().Item1; ILocalDateDoubleTimeSeries seriesExclusive = timeSeriesSource.GetHistoricalTimeSeries(UniqueId.Create("DbHts", "3580"), start, false, lastIncluded, false); Assert.Equal(series.Values.Count - 1, seriesExclusive.Values.Count); ILocalDateDoubleTimeSeries seriesInclusive = timeSeriesSource.GetHistoricalTimeSeries(UniqueId.Create("DbHts", "3580"), start, false, lastIncluded, true); Assert.Equal(series.Values.Count, seriesInclusive.Values.Count); }
private static void AssertSane(ILocalDateDoubleTimeSeries series, DateTimeOffset end) { AssertSane(series, DateTimeOffset.FromFileTime(0), end); }
private static void AssertSane(ILocalDateDoubleTimeSeries series) { AssertSane(series, DateTimeOffset.Now); }
public static void AssertSensibleValue(ILocalDateDoubleTimeSeries series) { Assert.NotNull(series); Assert.NotEmpty(series.Values); AssertSensibleValue(series.Values); }