Handling responsesedit

The AggregateDictionary found on `.Aggregations on ISearchResponse<T> has several helper methods so we can fetch our aggregation results easily in the correct type. Be sure to read more about these helper methods

Handling Responsesedit

response.ShouldBeValid();

var dateHistogram = response.Aggregations.DateHistogram("projects_started_per_month");
dateHistogram.Should().NotBeNull();
dateHistogram.Buckets.Should().NotBeNull();
dateHistogram.Buckets.Count.Should().BeGreaterThan(10);
foreach (var item in dateHistogram.Buckets)
{
    item.Date.Should().NotBe(default(DateTime));
    item.DocCount.Should().BeGreaterThan(0);

    var nested = item.Nested("project_tags");
    nested.Should().NotBeNull();

    var nestedTerms = nested.Terms("tags");
    nestedTerms.Buckets.Count.Should().BeGreaterThan(0);
}