public void TestGetPartitionDataWhenNoData() { var data = new PartitionDataForAllCategoriesBuilder().GetPartitionData(ProfileIds.SexualHealth, AreaCodes.England, IndicatorIds.SyphilisDiagnosis, SexIds.Persons, AgeIds.AllAges, AreaTypeIds.CountyAndUnitaryAuthority); Assert.AreEqual(AreaCodes.England, data.AreaCode); Assert.AreEqual(SexIds.Persons, data.SexId); Assert.AreEqual(AgeIds.AllAges, data.AgeId); Assert.IsFalse(data.Data.Any(), "There should be no data"); Assert.IsFalse(data.CategoryTypes.Any(), "There should be no category types"); }
public void TestGetPartitionTrendDataWhenNoData() { var indicatorId = IndicatorIds.LifeExpectancyAtBirth; var trendData = new PartitionDataForAllCategoriesBuilder().GetPartitionTrendData(ProfileIds.Phof, AreaCodes.England, indicatorId, SexIds.Male, AgeIds.AllAges, CategoryTypeIds.EthnicGroups5, AreaTypeIds.CountyAndUnitaryAuthority); Assert.IsNull(trendData.Limits); Assert.AreEqual(5, trendData.Labels.Count, "Expected 5 ethnic groups"); Assert.IsFalse(trendData.Periods.Any(), "No periods if no data"); Assert.IsFalse(trendData.TrendData[CategoryIds.EthnicityAsian].Any()); }
public void TestGetPartitionTrendData() { var indicatorId = IndicatorIds.LifeExpectancyAtBirth; var trendData = new PartitionDataForAllCategoriesBuilder().GetPartitionTrendData(ProfileIds.Phof, AreaCodes.England, indicatorId, SexIds.Male, AgeIds.AllAges, CategoryTypeIds.LsoaDeprivationDecilesWithinArea2010, AreaTypeIds.CountyAndUnitaryAuthority); Assert.IsNotNull(trendData.Limits); Assert.AreEqual(10, trendData.Labels.Count, "Expected 10 deciles"); Assert.IsTrue(trendData.Periods.Any()); Assert.IsTrue(trendData.TrendData[CategoryIds.MostDeprivedDecile].Any(), "Expected trend data"); }
public void TestGetPartitionData() { var indicatorId = IndicatorIds.LifeExpectancyAtBirth; var data = new PartitionDataForAllCategoriesBuilder().GetPartitionData(ProfileIds.Phof, AreaCodes.England, indicatorId, SexIds.Male,AgeIds.AllAges, AreaTypeIds.CountyAndUnitaryAuthority); Assert.AreEqual(AreaCodes.England, data.AreaCode); Assert.AreEqual(SexIds.Male, data.SexId); Assert.AreEqual(AgeIds.AllAges, data.AgeId); Assert.AreEqual(indicatorId, data.IndicatorId); CheckData(data); Assert.IsTrue(data.CategoryTypes.Any(), "No category types"); }