public void TestMentalHealthTrustsIncludingCombinedAcuteTrusts()
        {
            AreaTypeIdSplitter splitter = new AreaTypeIdSplitter(
                new[] { AreaTypeIds.MentalHealthTrustsIncludingCombinedAcuteTrusts });

            Assert.AreEqual(2, splitter.Ids.Count);
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.MentalHealthTrust));
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.CombinedMentalHealthAndAcuteTrust));
        }
        public void TestLocalAuthorityAndUnitaryAuthority()
        {
            AreaTypeIdSplitter splitter = new AreaTypeIdSplitter(
                new[] { AreaTypeIds.DistrictAndUnitaryAuthority });

            Assert.AreEqual(2, splitter.Ids.Count);
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.District));
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.UnitaryAuthority));
        }
        public void TestCountyAndUnitaryAuthorityAndPct()
        {
            AreaTypeIdSplitter splitter = new AreaTypeIdSplitter(
                new[] { AreaTypeIds.CountyAndUnitaryAuthority, AreaTypeIds.Pct });

            Assert.AreEqual(3, splitter.Ids.Count);
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.County));
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.UnitaryAuthority));
            Assert.IsTrue(splitter.Ids.Contains(AreaTypeIds.Pct));
        }
        public ProfileParameters(IAreaTypeListProvider areaTypeListProvider,
            int profileId, string ckanGroupName)
        {
            ProfileId = profileId;
            CkanGroupName = ckanGroupName;

            var areaTypeIds = areaTypeListProvider.GetAllAreaTypeIdsUsedInProfile(profileId);
            AreaTypeIds = new AreaTypeIdSplitter(areaTypeIds).Ids.Distinct().ToList();

            CategoryTypeIds = areaTypeListProvider.GetCategoryTypeIdsUsedInProfile(profileId);
        }
        public List<int> GetAllAreaTypeIdsUsedInProfile(int profileId)
        {
            var compositeChildAreaTypeIds = GetChildAreaTypeIdsUsedInProfiles(
                new List<int> { profileId });
            var childAreaTypeIds = new AreaTypeIdSplitter(compositeChildAreaTypeIds).Ids;

            var compositeParentAreaTypeIds = GetParentAreaTypeIdsUsedInProfile(profileId);
            var parentAreaTypeIds = new AreaTypeIdSplitter(compositeParentAreaTypeIds).Ids;

            var allAreaTypeIds = new List<int>();
            allAreaTypeIds.AddRange(childAreaTypeIds);
            allAreaTypeIds.AddRange(parentAreaTypeIds);
            allAreaTypeIds.Add(AreaTypeIds.Country);
            return allAreaTypeIds;
        }