Exemple #1
0
        public void HourlyAverage()
        {
            Series s = new Series();

            s.Add("1/1/2013 12:30", 55);
            s.Add("1/1/2013 13:00", 1);
            s.Add("1/1/2013 13:15", 1);
            s.Add("1/1/2013 14:01", 500);
            var avg = Math.Average(s, TimeInterval.Hourly);

            avg.WriteToConsole();

            Assert.AreEqual(55, avg["1/1/2013 12:00:00"].Value);
            Assert.AreEqual(1, avg["1/1/2013 13:00:00"].Value);
            Assert.AreEqual(500, avg["1/1/2013 14:00:00"].Value);
        }