Exemplo n.º 1
0
        public void CopyToTest()
        {
            TimePeriodChain timePeriods = new TimePeriodChain();

            ITimePeriod[] array1 = new ITimePeriod[0];
            timePeriods.CopyTo(array1, 0);

            SchoolDay schoolDay = new SchoolDay();

            ITimePeriod[] array2 = new ITimePeriod[schoolDay.Count];
            schoolDay.CopyTo(array2, 0);
            Assert.Equal(array2[0], schoolDay.Lesson1);
            Assert.Equal(array2[1], schoolDay.Break1);
            Assert.Equal(array2[2], schoolDay.Lesson2);
            Assert.Equal(array2[3], schoolDay.Break2);
            Assert.Equal(array2[4], schoolDay.Lesson3);
            Assert.Equal(array2[5], schoolDay.Break3);
            Assert.Equal(array2[6], schoolDay.Lesson4);

            ITimePeriod[] array3 = new ITimePeriod[schoolDay.Count + 3];
            schoolDay.CopyTo(array3, 3);
            Assert.Equal(array3[3], schoolDay.Lesson1);
            Assert.Equal(array3[4], schoolDay.Break1);
            Assert.Equal(array3[5], schoolDay.Lesson2);
            Assert.Equal(array3[6], schoolDay.Break2);
            Assert.Equal(array3[7], schoolDay.Lesson3);
            Assert.Equal(array3[8], schoolDay.Break3);
            Assert.Equal(array3[9], schoolDay.Lesson4);
        }         // CopyToTest
Exemplo n.º 2
0
        public void CopyToTest() {
            TimePeriodChain timePeriods = new TimePeriodChain();
            ITimePeriod[] array1 = new ITimePeriod[0];
            timePeriods.CopyTo(array1, 0);

            SchoolDay schoolDay = new SchoolDay();
            ITimePeriod[] array2 = new ITimePeriod[schoolDay.Count];
            schoolDay.CopyTo(array2, 0);
            Assert.AreEqual(array2[0], schoolDay.Lesson1);
            Assert.AreEqual(array2[1], schoolDay.Break1);
            Assert.AreEqual(array2[2], schoolDay.Lesson2);
            Assert.AreEqual(array2[3], schoolDay.Break2);
            Assert.AreEqual(array2[4], schoolDay.Lesson3);
            Assert.AreEqual(array2[5], schoolDay.Break3);
            Assert.AreEqual(array2[6], schoolDay.Lesson4);

            ITimePeriod[] array3 = new ITimePeriod[schoolDay.Count + 3];
            schoolDay.CopyTo(array3, 3);
            Assert.AreEqual(array3[3], schoolDay.Lesson1);
            Assert.AreEqual(array3[4], schoolDay.Break1);
            Assert.AreEqual(array3[5], schoolDay.Lesson2);
            Assert.AreEqual(array3[6], schoolDay.Break2);
            Assert.AreEqual(array3[7], schoolDay.Lesson3);
            Assert.AreEqual(array3[8], schoolDay.Break3);
            Assert.AreEqual(array3[9], schoolDay.Lesson4);
        }