public void Should_return_empty_if_not_exists_unit() { var items = new List<Location> { new Location("Stockholm", 10.0, 15.0), new Location("Växjö", 20.0, 20.0) }; var searchService = new SearchService(items); var searchString = "Adelaide"; var results = searchService.Match(searchString); Assert.IsTrue(results.Count() == 0); }
public void Should_return_valid_if_exists_unit() { var items = new List<Location> { new Location("Stockholm", 10.0, 15.0), new Location("Växjö", 20.0, 20.0) }; var searchService = new SearchService(items); var searchString = "Stockholm"; var results = searchService.Match(searchString); Assert.IsTrue(results.Count() == 1); Assert.IsTrue(results.First().Lat == 10.0); Assert.IsTrue(results.First().Lon == 15.0); }