protected override IEnumerable <ICategoryFunction> DetermineAggregations(System.Collections.Specialized.NameValueCollection requestParams) { var builder = new AggregationBuilder(requestParams); builder.MaybeAddDateAggregation("bizDate"); builder.MaybeAddByNameAggregation("bookId"); return(builder.ToList()); }
public void ShouldNotAddNyNameAggregationForEmptyRequest() { var req = new NameValueCollection(); var builder = new AggregationBuilder(req); builder.MaybeAddByNameAggregation("test"); Assert.AreEqual(0, builder.ToList().Count); }
public void ShouldAddByNameAggregationWhenParameterIsAvailable() { var req = new NameValueCollection(); req.Add("someString-granularity", "by-name"); var builder = new AggregationBuilder(req); builder.MaybeAddByNameAggregation("someString"); Assert.AreEqual(1, builder.ToList().Count); Assert.That(builder.ToList()[0], Is.InstanceOf(typeof(ByNameCategoryFunction))); }
protected override IEnumerable<ICategoryFunction> DetermineAggregations(System.Collections.Specialized.NameValueCollection requestParams) { var builder = new AggregationBuilder(requestParams); builder.MaybeAddDateAggregation("bizDate"); builder.MaybeAddByNameAggregation("bookId"); return builder.ToList(); }