public void TestEastingNorthingAreOnlyRetrievedOnRequest()
        {
            var areaTypeId = AreaTypeIds.CountyAndUnitaryAuthority;
            var parentAreasToInclude = new List<int> {areaTypeId};

            var results = new GeographicalSearch
            {
                AreEastingAndNorthingRetrieved = false
            }.SearchPlacePostcodes(NameOfCity, areaTypeId, parentAreasToInclude);
            CheckEastingAndNorthingAreNotDefined(results.First());

            results = new GeographicalSearch
            {
                AreEastingAndNorthingRetrieved = true
            }.SearchPlacePostcodes(NameOfCity, areaTypeId, parentAreasToInclude);
            CheckEastingAndNorthingAreDefined(results.First());
        }
 private static List<GeographicalSearchResult> GetResults(string text)
 {
     var areaTypeId = AreaTypeIds.CountyAndUnitaryAuthority;
     var results = new GeographicalSearch().SearchPlacePostcodes(text, areaTypeId, new List<int> {areaTypeId});
     return results;
 }
        public void Test_Parent_Areas_Are_Only_Retrieved_On_Request()
        {
            var areaTypeId = AreaTypeIds.Ccg;

            // Include parent area
            var results = new GeographicalSearch().SearchPlacePostcodes(NameOfCity, areaTypeId,
                new List<int> {areaTypeId});
            Assert.AreEqual(2, results.Count);

            // Do not include parent areas
            results = new GeographicalSearch().SearchPlacePostcodes(NameOfCity, AreaTypeIds.Ccg,
                new List<int>());
            Assert.AreEqual(1, results.Count);
        }