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.DateRange("projects_date_ranges");
dateHistogram.Should().NotBeNull();
dateHistogram.Buckets.Should().NotBeNull();

We specified three ranges so we expect to have three of them in the response

dateHistogram.Buckets.Count.Should().Be(3);
foreach (var item in dateHistogram.Buckets)
{
    item.DocCount.Should().BeGreaterThan(0);
}