public SortByStart ( ListSortDirection sortDirection = ListSortDirection.Ascending ) : void | ||
sortDirection | ListSortDirection | |
return | void |
public void SortByStartTest() { DateTime now = ClockProxy.Clock.Now; SchoolDay schoolDay = new SchoolDay( now ); TimePeriodCollection timePeriods = new TimePeriodCollection(); timePeriods.Add( schoolDay.Lesson4 ); timePeriods.Add( schoolDay.Break3 ); timePeriods.Add( schoolDay.Lesson3 ); timePeriods.Add( schoolDay.Break2 ); timePeriods.Add( schoolDay.Lesson2 ); timePeriods.Add( schoolDay.Break1 ); timePeriods.Add( schoolDay.Lesson1 ); timePeriods.SortByStart(); Assert.AreEqual( timePeriods[ 0 ], schoolDay.Lesson1 ); Assert.AreEqual( timePeriods[ 1 ], schoolDay.Break1 ); Assert.AreEqual( timePeriods[ 2 ], schoolDay.Lesson2 ); Assert.AreEqual( timePeriods[ 3 ], schoolDay.Break2 ); Assert.AreEqual( timePeriods[ 4 ], schoolDay.Lesson3 ); Assert.AreEqual( timePeriods[ 5 ], schoolDay.Break3 ); Assert.AreEqual( timePeriods[ 6 ], schoolDay.Lesson4 ); }