本文整理汇总了C#中ISearchResponse.ShouldBeValid方法的典型用法代码示例。如果您正苦于以下问题:C# ISearchResponse.ShouldBeValid方法的具体用法?C# ISearchResponse.ShouldBeValid怎么用?C# ISearchResponse.ShouldBeValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISearchResponse
的用法示例。
在下文中一共展示了ISearchResponse.ShouldBeValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var sigNames = response.Aggs.SignificantTerms("significant_names");
sigNames.Should().NotBeNull();
sigNames.DocCount.Should().BeGreaterThan(0);
}
示例2: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var sumTheHardWay = response.Aggs.ScriptedMetric("sum_the_hard_way");
sumTheHardWay.Should().NotBeNull();
sumTheHardWay.Value<int>().Should().BeGreaterThan(0);
}
示例3: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var max = response.Aggs.Max("max_commits");
max.Should().NotBeNull();
max.Value.Should().BeGreaterThan(0);
}
示例4: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var projectCount = response.Aggs.Cardinality("state_count");
projectCount.Should().NotBeNull();
projectCount.Value.Should().Be(3);
}
示例5: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var min = response.Aggs.Min("min_last_activity");
min.Should().NotBeNull();
min.Value.Should().BeGreaterThan(0);
min.ValueAsString.Should().NotBeNullOrEmpty();
}
示例6: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var allProjects = response.Aggs.Global("all_projects");
allProjects.Should().NotBeNull();
var names = allProjects.Terms("names");
names.Should().NotBeNull();
}
示例7: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitsOutlier = response.Aggs.PercentileRanks("commits_outlier");
commitsOutlier.Should().NotBeNull();
commitsOutlier.Items.Should().NotBeNullOrEmpty();
foreach (var item in commitsOutlier.Items)
item.Should().NotBeNull();
}
示例8: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var sample = response.Aggs.Sampler("sample");
sample.Should().NotBeNull();
var sigTags = sample.SignificantTerms("significant_names");
sigTags.Should().NotBeNull();
}
示例9: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitsAvg = response.Aggs.Average("average_commits");
commitsAvg.Should().NotBeNull();
commitsAvg.Value.Should().BeGreaterThan(0);
commitsAvg.Meta.Should().NotBeNull().And.HaveCount(1);
commitsAvg.Meta["foo"].Should().Be("bar");
}
示例10: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commits = response.Aggs.Histogram("commits");
commits.Should().NotBeNull();
commits.Buckets.Should().NotBeNull();
commits.Buckets.Count.Should().BeGreaterThan(0);
foreach (var item in commits.Buckets)
item.DocCount.Should().BeGreaterThan(0);
}
示例11: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitRanges = response.Aggs.Range("commit_ranges");
commitRanges.Should().NotBeNull();
commitRanges.Buckets.Count.Should().Be(3);
commitRanges.Buckets.Where(r => r.Key == "*-100.0").FirstOrDefault().Should().NotBeNull();
commitRanges.Buckets.Where(r => r.Key == "100.0-500.0").FirstOrDefault().Should().NotBeNull();
commitRanges.Buckets.Where(r => r.Key == "500.0-*").FirstOrDefault().Should().NotBeNull();
}
示例12: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var matrix = response.Aggs.MatrixStats("matrixstats");
matrix.Should().NotBeNull();
matrix.Fields.Should().NotBeNull().And.HaveCount(2);
AssertField(matrix, "numberOfCommits");
AssertField(matrix, "numberOfContributors");
}
示例13: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
foreach (var document in response.Documents)
{
document.Name.Should().NotBeNull();
document.StartedOn.Should().NotBe(default(DateTime));
document.Description.Should().BeNull();
}
}
示例14: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitStats = response.Aggs.Stats("commit_stats");
commitStats.Should().NotBeNull();
commitStats.Average.Should().BeGreaterThan(0);
commitStats.Max.Should().BeGreaterThan(0);
commitStats.Min.Should().BeGreaterThan(0);
commitStats.Count.Should().BeGreaterThan(0);
commitStats.Sum.Should().BeGreaterThan(0);
}
示例15: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var projectsPerMonth = response.Aggs.DateHistogram("projects_started_per_month");
projectsPerMonth.Should().NotBeNull();
projectsPerMonth.Buckets.Should().NotBeNull();
projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
var averageCommits = response.Aggs.AverageBucket("average_commits_per_month");
averageCommits.Should().NotBeNull();
averageCommits.Value.Should().BeGreaterThan(0);
}