コード例 #1
0
        protected override IEnumerable <ICategoryFunction> DetermineAggregations(System.Collections.Specialized.NameValueCollection requestParams)
        {
            var builder = new AggregationBuilder(requestParams);

            builder.MaybeAddDateAggregation("bizDate");
            builder.MaybeAddByNameAggregation("bookId");
            return(builder.ToList());
        }
コード例 #2
0
        public void ShouldNotAddNyNameAggregationForEmptyRequest()
        {
            var req     = new NameValueCollection();
            var builder = new AggregationBuilder(req);

            builder.MaybeAddByNameAggregation("test");
            Assert.AreEqual(0, builder.ToList().Count);
        }
コード例 #3
0
        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)));
        }
コード例 #4
0
        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)));
        }
コード例 #5
0
        public void ShouldNotAddNyNameAggregationForEmptyRequest()
        {
            var req = new NameValueCollection();
              var builder = new AggregationBuilder(req);

              builder.MaybeAddByNameAggregation("test");
              Assert.AreEqual(0, builder.ToList().Count);
        }
コード例 #6
0
 protected override IEnumerable<ICategoryFunction> DetermineAggregations(System.Collections.Specialized.NameValueCollection requestParams)
 {
     var builder = new AggregationBuilder(requestParams);
       builder.MaybeAddDateAggregation("bizDate");
       builder.MaybeAddByNameAggregation("bookId");
       return builder.ToList();
 }