public void SortByEndTest() { DateTime now = ClockProxy.Clock.Now; SchoolDay schoolDay = new SchoolDay(now); TimePeriodCollection timePeriods = new TimePeriodCollection(); timePeriods.AddAll(schoolDay); timePeriods.SortByEnd(ListSortDirection.Descending); Assert.Equal(timePeriods[0], schoolDay.Lesson4); Assert.Equal(timePeriods[1], schoolDay.Break3); Assert.Equal(timePeriods[2], schoolDay.Lesson3); Assert.Equal(timePeriods[3], schoolDay.Break2); Assert.Equal(timePeriods[4], schoolDay.Lesson2); Assert.Equal(timePeriods[5], schoolDay.Break1); Assert.Equal(timePeriods[6], schoolDay.Lesson1); timePeriods.SortByEnd(); Assert.Equal(timePeriods[0], schoolDay.Lesson1); Assert.Equal(timePeriods[1], schoolDay.Break1); Assert.Equal(timePeriods[2], schoolDay.Lesson2); Assert.Equal(timePeriods[3], schoolDay.Break2); Assert.Equal(timePeriods[4], schoolDay.Lesson3); Assert.Equal(timePeriods[5], schoolDay.Break3); Assert.Equal(timePeriods[6], schoolDay.Lesson4); } // SortByEndTest
public void SortByEndTest() { DateTime now = ClockProxy.Clock.Now; SchoolDay schoolDay = new SchoolDay(now); TimePeriodCollection timePeriods = new TimePeriodCollection(); timePeriods.AddAll(schoolDay); timePeriods.SortByEnd(); timePeriods[0].Should().Be(schoolDay.Lesson4); timePeriods[1].Should().Be(schoolDay.Break3); timePeriods[2].Should().Be(schoolDay.Lesson3); timePeriods[3].Should().Be(schoolDay.Break2); timePeriods[4].Should().Be(schoolDay.Lesson2); timePeriods[5].Should().Be(schoolDay.Break1); timePeriods[6].Should().Be(schoolDay.Lesson1); }