private static void SortByLastNameDescending(ISortService sortService, IList <Person> unsortedList) { IList <Person> sortedBylastName = sortService.SortByLastNameDescending(unsortedList); Console.WriteLine(" "); Console.WriteLine("Sorted by last name descending."); PrintList(sortedBylastName); }
public override IList <Person> GetGersons(IList <Person> unsortedList, string sortBy) { IList <Person> persons = new List <Person>(); if (sortBy.Contains(DBWebAPI.Model.Constants.Name)) { persons = _sortService.SortByLastNameDescending(unsortedList); } return(persons); }
public void SortServiceShouldSortByLastNameDescending() { //arrange List <Person> unsortedList = GetUnsortedPersonList(); //act IList <Person> sortedList = _sortService.SortByLastNameDescending(unsortedList); var first = sortedList.FirstOrDefault(); var last = sortedList.LastOrDefault(); //assert Assert.AreEqual("Whiteside", first.LastName); Assert.AreEqual("Bearns", last.LastName); }