Пример #1
0
        public void TrimmingAllNullValuesTimeSeriesDataFromTheStart()
        {
            var timeSeriesData = new TimeSeriesData <AnnualDecimal>();

            timeSeriesData.AddRange(new[]
            {
                new AnnualDecimal(10, null),
                new AnnualDecimal(11, null),
                new AnnualDecimal(12, null),
                new AnnualDecimal(13, null),
                new AnnualDecimal(14, null),
                new AnnualDecimal(15, null)
            });
            timeSeriesData.TrimNullDataFromTheStart();
            Assert.That(timeSeriesData.Count, Is.EqualTo(0));
        }
Пример #2
0
        public void ShouldOnlyTrimTheStart()
        {
            var timeSeriesData = new TimeSeriesData <AnnualDecimal>();

            timeSeriesData.AddRange(new[]
            {
                new AnnualDecimal(10, null),
                new AnnualDecimal(11, null),
                new AnnualDecimal(12, 12),
                new AnnualDecimal(13, 13),
                new AnnualDecimal(14, null),
                new AnnualDecimal(15, null)
            });
            timeSeriesData.TrimNullDataFromTheStart();
            Assert.That(timeSeriesData.Count, Is.EqualTo(4));
            Assert.That(timeSeriesData.GetYear(timeSeriesData.StartYear()), Is.EqualTo(new AnnualDecimal(12, 12)));
            Assert.That(timeSeriesData.GetYear(timeSeriesData.EndYear()), Is.EqualTo(new AnnualDecimal(15, null)));
        }