当前位置: 首页>>代码示例>>C#>>正文


C# ISearchResponse.ShouldBeValid方法代码示例

本文整理汇总了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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:7,代码来源:SignificantTermsAggregationUsageTests.cs

示例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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:7,代码来源:ScriptedMetricAggregationUsageTests.cs

示例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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:7,代码来源:MaxAggregationUsageTests.cs

示例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);
        }
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:7,代码来源:CardinalityAggregationUsageTests.cs

示例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();
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:8,代码来源:MinAggregationUsageTests.cs

示例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();
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:8,代码来源:GlobalAggregationUsageTests.cs

示例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();
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:9,代码来源:PercentileRanksAggregationUsageTests.cs

示例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();
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:9,代码来源:SamplerAggregationUsageTests.cs

示例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");
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:9,代码来源:AverageAggregationUsageTests.cs

示例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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:10,代码来源:HistogramAggregationUsageTests.cs

示例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();
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:10,代码来源:RangeAggregationUsageTests.cs

示例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");
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:10,代码来源:MatrixStatsAggregationUsageTests.cs

示例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();
			}
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:11,代码来源:SourceFilteringUsageTests.cs

示例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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:11,代码来源:StatsAggregationUsageTests.cs

示例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);
		}
开发者ID:niemyjski,项目名称:elasticsearch-net,代码行数:13,代码来源:AverageBucketAggregationUsageTests.cs


注:本文中的ISearchResponse.ShouldBeValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。