public void GetKLA_Basic_NoQuery() { //Create new ESRegAggConnection... IConnection conn = new ESResAggSvcConnection("ResearchTypes_EmptyQuery"); //Expected Aggs KeyLabelAggResult[] expectedAggs = new KeyLabelAggResult[] { new KeyLabelAggResult() { Key = "basic", Label = "Basic", Count = 94 }, new KeyLabelAggResult() { Key = "translational", Label = "Translational", Count = 66 }, new KeyLabelAggResult() { Key = "clinical_trials", Label = "Clinical Trials", Count = 42 }, new KeyLabelAggResult() { Key = "epidemiologic", Label = "Epidemiologic", Count = 26 }, new KeyLabelAggResult() { Key = "clinical", Label = "Clinical", Count = 5 } }; ESResourceAggregationService aggSvc = this.GetService <ESResourceAggregationService>(conn); KeyLabelAggResult[] actualAggs = aggSvc.GetKeyLabelAggregation("researchTypes", new ResourceQuery()); //Order does matter here, so we can compare the arrays Assert.Equal(expectedAggs, actualAggs, new KeyLabelAggResultComparer()); }
public void GetKLA_SubType_NoMatches() { //Create new ESRegAggConnection... IConnection conn = new ESResAggSvcConnection("SubtoolTypes_WithToolType_NoResults"); //Expected Aggs KeyLabelAggResult[] expectedAggs = new KeyLabelAggResult[] { }; ESResourceAggregationService aggSvc = this.GetService <ESResourceAggregationService>(conn); KeyLabelAggResult[] actualAggs = aggSvc.GetKeyLabelAggregation( "toolSubtypes", new ResourceQuery { Filters = new Dictionary <string, string[]> { { "toolTypes", new string[] { "nohits" } } } } ); //Order does matter here, so we can compare the arrays Assert.Equal(expectedAggs, actualAggs, new KeyLabelAggResultComparer()); }
public void GetKLA_SubType_NoQuery() { //Create new ESRegAggConnection... IConnection conn = new ESResAggSvcConnection("SubtoolTypes_WithToolType"); //Expected Aggs KeyLabelAggResult[] expectedAggs = new KeyLabelAggResult[] { new KeyLabelAggResult() { Key = "clinical_data", Label = "Clinical Data", Count = 21 }, new KeyLabelAggResult() { Key = "imaging", Label = "Imaging", Count = 14 }, new KeyLabelAggResult() { Key = "genomic_datasets", Label = "Genomic Datasets", Count = 13 }, new KeyLabelAggResult() { Key = "epidemiologic_data", Label = "Epidemiologic Data", Count = 12 }, new KeyLabelAggResult() { Key = "patient_registries", Label = "Patient Registries", Count = 3 }, new KeyLabelAggResult() { Key = "biological_networks", Label = "Biological Networks", Count = 2 } }; ESResourceAggregationService aggSvc = this.GetService <ESResourceAggregationService>(conn); KeyLabelAggResult[] actualAggs = aggSvc.GetKeyLabelAggregation( "toolSubtypes", new ResourceQuery { Filters = new Dictionary <string, string[]> { { "toolTypes", new string[] { "datasets_databases" } } } } ); //Order does matter here, so we can compare the arrays Assert.Equal(expectedAggs, actualAggs, new KeyLabelAggResultComparer()); }