File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed
Tests/Nest.Tests.Integration Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,9 @@ internal static class CountPathInfo
1919 public static void Update ( ElasticsearchPathInfo < CountRequestParameters > pathInfo , ICountRequest request )
2020 {
2121 var source = request . RequestParameters . GetQueryStringValue < string > ( "source" ) ;
22- pathInfo . HttpMethod = ! source . IsNullOrEmpty ( )
22+ pathInfo . HttpMethod = source . IsNullOrEmpty ( )
2323 ? PathInfoHttpMethod . GET
2424 : PathInfoHttpMethod . POST ;
25-
26- pathInfo . HttpMethod = PathInfoHttpMethod . POST ;
2725 }
2826 }
2927
Original file line number Diff line number Diff line change 1+ using FluentAssertions ;
2+ using Nest . Tests . MockData . Domain ;
3+ using NUnit . Framework ;
4+ using System ;
5+ using System . Collections . Generic ;
6+ using System . Linq ;
7+ using System . Text ;
8+ using System . Threading . Tasks ;
9+
10+ namespace Nest . Tests . Integration . Core
11+ {
12+ [ TestFixture ]
13+ public class CountTests : IntegrationTests
14+ {
15+ [ Test ]
16+ public void CountTest ( )
17+ {
18+ var response = this . Client . Count < ElasticsearchProject > ( ) ;
19+
20+ response . IsValid . Should ( ) . BeTrue ( ) ;
21+ response . Count . Should ( ) . BeGreaterThan ( 0 ) ;
22+ }
23+
24+ [ Test ]
25+ public void CountWithQueryTest ( )
26+ {
27+ var response = this . Client . Count < ElasticsearchProject > ( c => c
28+ . Query ( q => q
29+ . Match ( m => m
30+ . OnField ( p => p . Country )
31+ . Query ( "Sweden" )
32+ )
33+ )
34+ ) ;
35+
36+ response . IsValid . Should ( ) . BeTrue ( ) ;
37+ response . Count . Should ( ) . BeGreaterThan ( 0 ) ;
38+ }
39+ }
40+ }
Original file line number Diff line number Diff line change 104104 <Compile Include =" Connection\Thrift\ThiftBugReportTests.cs" />
105105 <Compile Include =" Core\Bulk\BulkTests.cs" />
106106 <Compile Include =" Core\Bulk\BulkUpdateTests.cs" />
107+ <Compile Include =" Core\CountTests.cs" />
107108 <Compile Include =" Core\Explain\ExplainTests.cs" />
108109 <Compile Include =" Core\Exists\AliasExists.cs" />
109110 <Compile Include =" Core\GetFieldMapping\GetFieldMappingTests.cs" />
You can’t perform that action at this time.
0 commit comments