public void TestAreas() { var code = NearestNeighbourArea.CreateAreaCode(1, "a"); var area = new NearestNeighbourArea(code); area.Neighbours = new [] { new AreaCodeNeighbourMapping{ NeighbourAreaCode = AreaCodes.CountyUa_Cambridgeshire}, new AreaCodeNeighbourMapping{ NeighbourAreaCode = AreaCodes.CountyUa_Cumbria} }; var areas = new NearestNeighbourAreaListBuilder(ReaderFactory.GetAreasReader(), area).Areas; Assert.AreEqual(2, areas.Count); }
public IList<IArea> ReadChildAreas(string parentAreaCode, int profileId, int childAreaTypeId) { IList<IArea> childAreas; if (NearestNeighbourArea.IsNearestNeighbourAreaCode(parentAreaCode)) { var nearestNeighbourArea = (NearestNeighbourArea)AreaFactory.NewArea(_areasReader, parentAreaCode); childAreas = new NearestNeighbourAreaListBuilder(_areasReader, nearestNeighbourArea).Areas; } else { childAreas = new ChildAreaListBuilder(_areasReader, parentAreaCode, childAreaTypeId) .ChildAreas; } IgnoredAreasFilter filter = IgnoredAreasFilterFactory.New(profileId); return filter.RemoveAreasIgnoredEverywhere(childAreas).ToList(); }