Esempio n. 1
0
        public void InitEngines()
        {
            SeqOfYears history = new SeqOfYears(History());

            InitWithHistory(history.YearsIntervalList());

            MonthPeriod defaultPeriod = MonthPeriod.BeginYear(DefaultYear());

            DefaultInstance = ResolveEngine(defaultPeriod);
        }
Esempio n. 2
0
        public void Should_Return_Interval_2017to2099_For_Period_2018()
        {
            UInt16[] testChangeYears = new UInt16[] { 2011, 2012, 2014, 2016, 2017, 0 };

            SeqOfYears testYearArray = new SeqOfYears(testChangeYears);

            MonthPeriod testPeriod   = new MonthPeriod(2018, 1);
            SpanOfYears expInterval  = new SpanOfYears(2017, 2099);
            SpanOfYears testInterval = testYearArray.YearsIntervalForPeriod(testPeriod);

            Assert.AreEqual(expInterval, testInterval);
        }
Esempio n. 3
0
        public void Should_Return_IntervalArray_2011_2015()
        {
            UInt16[] testChangeYears = new UInt16[] { 2011, 2012, 2014, 2016, 2017, 0 };

            SeqOfYears testYearArray = new SeqOfYears(testChangeYears);

            SpanOfYears[] expIntervalArray = new SpanOfYears[] {
                new SpanOfYears(2011, 2011),
                new SpanOfYears(2012, 2013),
                new SpanOfYears(2014, 2015),
                new SpanOfYears(2016, 2016),
                new SpanOfYears(2017, 2099)
            };
            SpanOfYears[] testIntervalArray = testYearArray.YearsIntervalList();
            Assert.AreEqual(expIntervalArray, testIntervalArray);
        }