Exemple #1
0
        public void TrimmingAllNullValuesTimeSeriesDataFromTheEnd()
        {
            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.TrimNullDataFromTheEnd();
            Assert.That(timeSeriesData.Count, Is.EqualTo(0));
        }
Exemple #2
0
        public void ShouldOnlyTrimTheEnd()
        {
            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.TrimNullDataFromTheEnd();
            Assert.That(timeSeriesData.Count, Is.EqualTo(4));
            Assert.That(timeSeriesData.GetYear(timeSeriesData.StartYear()), Is.EqualTo(new AnnualDecimal(10, null)));
            Assert.That(timeSeriesData.GetYear(timeSeriesData.EndYear()), Is.EqualTo(new AnnualDecimal(13, 13)));
        }