public void TestLowerTierAuthorityBuild() { var builder = new AreaCodeToCategoryIdMapBuilder { ChildAreaTypeId = AreaTypeIds.DistrictAndUnitaryAuthority, CategoryTypeId = CategoryTypeIds.DeprivationDecileDistrictAndUA2010 }; Dictionary<string, int> map = builder.Build(); Assert.AreEqual(10, map[AreaCodes.DistrictUa_SouthCambridgeshire]); }
public void TestBuild() { var builder = new AreaCodeToCategoryIdMapBuilder { ChildAreaTypeId = AreaTypeIds.CountyAndUnitaryAuthority, CategoryTypeId = CategoryTypeIds.DeprivationDecileCountyAndUA2010 }; Dictionary<string, int> map = builder.Build(); Assert.AreEqual(9, map[AreaCodes.CountyUa_Cambridgeshire]); }
public Dictionary<string, int> GetAreaCodeToCategoryIdMap() { Dictionary<string, int> areaCodeToCategoryIdMap = new AreaCodeToCategoryIdMapBuilder { ChildAreaTypeId = _parameters.ChildAreaTypeId, CategoryTypeId = _parameters.CategoryTypeId }.Build(); /* TODO #159 * if no categories found in database then may need to read * values from PHOLIO and calculate quintiles */ var areaCodes = ReaderFactory.GetProfileReader() .GetAreaCodesToIgnore(_parameters.ProfileId) .AreaCodesIgnoredEverywhere; var filteredMap = areaCodeToCategoryIdMap .Where(x => areaCodes.Contains(x.Key) == false) .ToDictionary(x => x.Key, x => x.Value); return filteredMap; }