public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.FindAgeRange(SearchType.SmallestDifference); Assert.Null(result.PersonA); Assert.Null(result.PersonB); }
public void Returns_Closest_Two_For_Four_People() { var list = new List <Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.FindAgeRange(SearchType.SmallestDifference); Assert.Same(sue, result.PersonA); Assert.Same(greg, result.PersonB); }
public void Returns_Furthest_Two_For_Two_People() { var list = new List <Person>() { greg, mike }; var finder = new Finder(list); var result = finder.FindAgeRange(SearchType.GreatestDifference); Assert.Same(greg, result.PersonA); Assert.Same(mike, result.PersonB); }