예제 #1
0
        public void CopyToTest()
        {
            DateTime currentCalendarYear  = Now.CalendarYear;
            DateTime previousCalendarYear = currentCalendarYear.AddYears(-1);
            DateTime nextCalendarYear     = currentCalendarYear.AddYears(1);

            DateTimeSet dateTimeSet = new DateTimeSet();

            dateTimeSet.Add(nextCalendarYear);
            dateTimeSet.Add(currentCalendarYear);
            dateTimeSet.Add(previousCalendarYear);

            DateTime[] array = new DateTime[3];
            dateTimeSet.CopyTo(array, 0);
            Assert.Equal(array[0], previousCalendarYear);
            Assert.Equal(array[1], currentCalendarYear);
            Assert.Equal(array[2], nextCalendarYear);
        }         // CopyToTest
예제 #2
0
        public void CopyToTest()
        {
            DateTime currentCalendarYear  = TimeTool.CurrentCalendarYear;
            DateTime previousCalendarYear = currentCalendarYear.AddYears(-1);
            DateTime nextCalendarYear     = currentCalendarYear.AddYears(1);

            DateTimeSet dateTimeSet = new DateTimeSet
            {
                nextCalendarYear,
                currentCalendarYear,
                previousCalendarYear
            };

            DateTime[] array = new DateTime[3];
            dateTimeSet.CopyTo(array, 0);
            Assert.AreEqual(array[0], previousCalendarYear);
            Assert.AreEqual(array[1], currentCalendarYear);
            Assert.AreEqual(array[2], nextCalendarYear);
        }
예제 #3
0
        public void CopyToTest() {
            DateTime currentCalendarYear = TimeTool.CurrentCalendarYear;
            DateTime previousCalendarYear = currentCalendarYear.AddYears(-1);
            DateTime nextCalendarYear = currentCalendarYear.AddYears(1);

            DateTimeSet dateTimeSet = new DateTimeSet
                                      {
                                          nextCalendarYear,
                                          currentCalendarYear,
                                          previousCalendarYear
                                      };

            DateTime[] array = new DateTime[3];
            dateTimeSet.CopyTo(array, 0);
            Assert.AreEqual(array[0], previousCalendarYear);
            Assert.AreEqual(array[1], currentCalendarYear);
            Assert.AreEqual(array[2], nextCalendarYear);
        }