diff --git a/src/CodeGeneration/CodeGeneration.LowLevelClient/ApiGenerator.cs b/src/CodeGeneration/CodeGeneration.LowLevelClient/ApiGenerator.cs index 2c24b915fd0..34667ac36e4 100644 --- a/src/CodeGeneration/CodeGeneration.LowLevelClient/ApiGenerator.cs +++ b/src/CodeGeneration/CodeGeneration.LowLevelClient/ApiGenerator.cs @@ -18,8 +18,8 @@ namespace CodeGeneration.LowLevelClient { public static class ApiGenerator { - private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch/tree/v1.2.0/rest-api-spec/api"; - private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch/v1.2.0/rest-api-spec/api/"; + private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch/tree/v1.3.2/rest-api-spec/api"; + private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch/v1.3.2/rest-api-spec/api/"; private readonly static string _nestFolder = @"..\..\..\..\..\src\Nest\"; private readonly static string _esNetFolder = @"..\..\..\..\..\src\Elasticsearch.Net\"; private readonly static string _viewFolder = @"..\..\Views\"; diff --git a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Domain/TestSuite.cs b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Domain/TestSuite.cs index a03f65c79fe..b8d33b4f09a 100644 --- a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Domain/TestSuite.cs +++ b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Domain/TestSuite.cs @@ -134,6 +134,8 @@ private static string PropertyPath(string value) return "this._status"; value = Regex.Replace(value, @"\.(\d+)\.?", "[$1]."); + //make sure we escape reserverd keywords + value = Regex.Replace(value, @"(^|\.)(class|params|default)(\.|$)", "$1@$2$3"); if (value.Length > 0) value = "." + value; if (Regex.IsMatch(value, @"([\s\-]|\\\.)")) diff --git a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Extensions.cs b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Extensions.cs index de6e208dbdf..bd9a0a266b1 100644 --- a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Extensions.cs +++ b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/Extensions.cs @@ -124,7 +124,7 @@ public static string SerializeToAnonymousObject(this object o, string indentatio return "\t\t\t\t" + m.Value.Replace(" ", "\t"); }, RegexOptions.Multiline); //escape c# keywords in the anon object - anon = anon.Replace("default=", "@default=").Replace("params=", "@params="); + anon = anon.Replace("default=", "@default=").Replace("params=", "@params=").Replace("class=", "@class="); //docs contain different types of anon objects, quick fix by making them a dynamic[] anon = anon.Replace("docs= new []", "docs= new dynamic[]"); //fix empty untyped arrays, default to string @@ -145,6 +145,8 @@ public static string EscapeQuotes(this string s) public static string SurroundWithQuotes(this string s) { + if (Regex.IsMatch(s, @"^\d+(?:\.\d+)?$")) + return s; return "@\"" + s.EscapeQuotes() + "\""; } } diff --git a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/YamlTestsGenerator.cs b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/YamlTestsGenerator.cs index 7ffa48db90d..5aaf393275f 100644 --- a/src/CodeGeneration/CodeGeneration.YamlTestsRunner/YamlTestsGenerator.cs +++ b/src/CodeGeneration/CodeGeneration.YamlTestsRunner/YamlTestsGenerator.cs @@ -25,8 +25,8 @@ namespace CodeGeneration.YamlTestsRunner using YamlTestSuite = Dictionary; public static class YamlTestsGenerator { - private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch/tree/v1.2.1/rest-api-spec/test"; - private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch/v1.2.1/rest-api-spec/test/"; + private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch/tree/v1.3.2/rest-api-spec/test"; + private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch/v1.3.2/rest-api-spec/test/"; private readonly static string _testProjectFolder = @"..\..\..\..\..\src\Tests\Elasticsearch.Net.Integration.Yaml\"; private readonly static string _rawClientInterface = @"..\..\..\..\..\src\Elasticsearch.Net\IElasticsearchClient.generated.cs"; private readonly static string _viewFolder = @"..\..\Views\"; @@ -96,7 +96,8 @@ public static YamlSpecification GetYamlTestSpecification(bool useCache = false) "index/60_refresh.yaml", "create/60_refresh.yaml", "update/60_refresh.yaml", - "search_shards/10_basic.yaml" + "search_shards/10_basic.yaml", + "template/10_basic.yaml" }; private static IList GetFolderFiles(string folder, bool useCache = false) diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/Elasticsearch.Net.Integration.Yaml.csproj b/src/Tests/Elasticsearch.Net.Integration.Yaml/Elasticsearch.Net.Integration.Yaml.csproj index e6fc2e92672..93fe06adbc7 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/Elasticsearch.Net.Integration.Yaml.csproj +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/Elasticsearch.Net.Integration.Yaml.csproj @@ -1,4 +1,4 @@ - + @@ -95,7 +95,6 @@ - @@ -146,7 +145,6 @@ - @@ -192,8 +190,12 @@ - - + + + + + + @@ -223,14 +225,18 @@ + + + + @@ -238,12 +244,10 @@ - - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/10_basic.yaml.cs index 610dcfdadac..27d91dc54c8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/20_list_of_strings.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/20_list_of_strings.yaml.cs index d3961c40ec3..c6435854e12 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/20_list_of_strings.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/20_list_of_strings.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/30_big_string.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/30_big_string.yaml.cs index f6abb7f7444..c23f9759f75 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/30_big_string.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/bulk/30_big_string.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.aliases/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.aliases/10_basic.yaml.cs index 424c3ecdf09..a41573e9117 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.aliases/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.aliases/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.allocation/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.allocation/10_basic.yaml.cs index 200079c8ca1..3b8b2fa1707 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.allocation/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.allocation/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.count/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.count/10_basic.yaml.cs index d57622c6284..2ca1030e2c7 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.count/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.count/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -43,7 +46,7 @@ public void TestCatCountOutput2Test() //match this._status: this.IsMatch(this._status, @"/# epoch timestamp count -^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \s $/ +^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \s+ \n $/ "); //do index @@ -59,7 +62,7 @@ public void TestCatCountOutput2Test() //match this._status: this.IsMatch(this._status, @"/# epoch timestamp count -^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/ +^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s+ \n $/ "); //do index @@ -77,7 +80,7 @@ public void TestCatCountOutput2Test() //match this._status: this.IsMatch(this._status, @"/# count -^ 2 \s $/ +^ 2 \s+ \n $/ "); //do cat.count @@ -85,7 +88,7 @@ public void TestCatCountOutput2Test() //match this._status: this.IsMatch(this._status, @"/# epoch timestamp count -^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/ +^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s+ \n $/ "); //do cat.count diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.fielddata/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.fielddata/10_basic.yaml.cs index 6411755e386..dba78fdd8bd 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.fielddata/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.fielddata/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.recovery/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.recovery/10_basic.yaml.cs index 24be1fb35ef..e1f25062301 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.recovery/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.recovery/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.shards/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.shards/10_basic.yaml.cs index 42c07b4bcf4..d21ace56245 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.shards/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.shards/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.thread_pool/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.thread_pool/10_basic.yaml.cs index 32afa12ab7d..5e59cf5d4a1 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.thread_pool/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cat.thread_pool/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.pending_tasks/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.pending_tasks/10_basic.yaml.cs index ad7a1549927..e73609e8256 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.pending_tasks/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.pending_tasks/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.put_settings/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.put_settings/10_basic.yaml.cs index e0f4f73e536..e75e115283b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.put_settings/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.put_settings/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -40,7 +43,7 @@ public void TestPutSettings2Test() //match _response.transient: this.IsMatch(_response.transient, new Dictionary { - { @"discovery.zen.minimum_master_nodes", @"1" } + { @"discovery.zen.minimum_master_nodes", 1 } }); //do cluster.get_settings @@ -50,7 +53,7 @@ public void TestPutSettings2Test() //match _response.transient: this.IsMatch(_response.transient, new Dictionary { - { @"discovery.zen.minimum_master_nodes", @"1" } + { @"discovery.zen.minimum_master_nodes", 1 } }); } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/10_basic.yaml.cs index 261cf453032..b963f81331c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/11_explain.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/11_explain.yaml.cs index 844a74e6804..4ca7de4efb2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/11_explain.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.reroute/11_explain.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/10_basic.yaml.cs index 8d58db8b51c..e32e621604b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/20_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/20_filtering.yaml.cs index 4c561fb3ae6..1cd3aae7799 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/20_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/cluster.state/20_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -98,6 +101,12 @@ public void FilteringTheClusterStateByBlocksShouldReturnTheBlocks3Test() //length _response.blocks: 1; this.IsLength(_response.blocks, 1); + //do indices.put_settings + _body = new Dictionary { + { @"index.blocks.read_only", @"false" } + }; + this.Do(()=> _client.IndicesPutSettings("testidx", _body)); + } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/10_with_id.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/10_with_id.yaml.cs index 36670e66359..570937d00dd 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/10_with_id.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/10_with_id.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/15_without_id.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/15_without_id.yaml.cs index efd4a75c5f4..25d30ced34d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/15_without_id.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/15_without_id.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/30_internal_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/30_internal_version.yaml.cs index e0d2e1b8208..9b54810c628 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/30_internal_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/30_internal_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/35_external_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/35_external_version.yaml.cs index 5981dcc57f5..1bf6d2f07eb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/35_external_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/35_external_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/36_external_gte_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/36_external_gte_version.yaml.cs index 1803103bee7..77178e5c7b0 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/36_external_gte_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/36_external_gte_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/37_force_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/37_force_version.yaml.cs index 283ccbca04e..ace0eee92fc 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/37_force_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/37_force_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/40_routing.yaml.cs index d4bca747732..fe1d1a17d24 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/50_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/50_parent.yaml.cs index c3bc9d89355..5ea67bef08a 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/50_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/50_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/55_parent_with_routing.yaml.cs index 055a74babc2..2974a4e95aa 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/60_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/60_refresh.yaml.cs deleted file mode 100644 index c91db7c9f61..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/60_refresh.yaml.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.Create10 -{ - public partial class Create10YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class Refresh1Tests : YamlTestsBase - { - [Test] - public void Refresh1Test() - { - - //do indices.create - _body = new { - settings= new Dictionary { - { "index.refresh_interval", "-1" } - } - }; - this.Do(()=> _client.IndicesCreate("test_1", _body)); - - //do cluster.health - this.Do(()=> _client.ClusterHealth(nv=>nv - .AddQueryString("wait_for_status", @"yellow") - )); - - //do create - _body = new { - foo= "bar" - }; - this.Do(()=> _client.Index("test_1", "test", "1", _body, nv=>nv - .AddQueryString("op_type", @"create") - )); - - //do search - _body = new { - query= new { - term= new { - _id= "1" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 0); - - //do create - _body = new { - foo= "bar" - }; - this.Do(()=> _client.Index("test_1", "test", "2", _body, nv=>nv - .AddQueryString("refresh", 1) - .AddQueryString("op_type", @"create") - )); - - //do search - _body = new { - query= new { - term= new { - _id= "2" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 1); - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/70_timestamp.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/70_timestamp.yaml.cs index a2607d78b98..6f1d5f02f38 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/70_timestamp.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/70_timestamp.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -59,7 +62,7 @@ public void Timestamp1Test() foo= "bar" }; this.Do(()=> _client.Index("test_1", "test", "1", _body, nv=>nv - .AddQueryString("timestamp", @"1372011280000") + .AddQueryString("timestamp", 1372011280000) .AddQueryString("op_type", @"create") )); @@ -69,7 +72,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); //do delete this.Do(()=> _client.Delete("test_1", "test", "1")); @@ -89,7 +92,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/75_ttl.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/75_ttl.yaml.cs index 6ede22ec7d8..830ecbf6548 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/create/75_ttl.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/create/75_ttl.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/10_basic.yaml.cs index a0d9ac78d3f..6cb00a27b26 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/20_internal_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/20_internal_version.yaml.cs index 38bff479995..faabc2db648 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/20_internal_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/20_internal_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/25_external_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/25_external_version.yaml.cs index b688661e487..af5addf91f6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/25_external_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/25_external_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/26_external_gte_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/26_external_gte_version.yaml.cs index bdaaee1c527..0aeeee0a8b7 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/26_external_gte_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/26_external_gte_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/27_force_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/27_force_version.yaml.cs index 1419e31daa7..0751e3f1cf6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/27_force_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/27_force_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/30_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/30_routing.yaml.cs index 5d02228dc90..df356a136b2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/30_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/30_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/40_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/40_parent.yaml.cs index d63bfdeafb4..ff547ce411b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/40_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/40_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/45_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/45_parent_with_routing.yaml.cs index e7aea683fc3..21ab0ecee64 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/45_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/45_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/50_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/50_refresh.yaml.cs index 68f83cbcb68..7ecc6ac36e7 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/50_refresh.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/50_refresh.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/60_missing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/60_missing.yaml.cs index ca380848b56..cc464f8d067 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/60_missing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete/60_missing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete_by_query/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete_by_query/10_basic.yaml.cs index 3740516bfb5..770d44a1d5a 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/delete_by_query/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/delete_by_query/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/10_basic.yaml.cs index c11cfa99305..3da78330a94 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/30_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/30_parent.yaml.cs index 9f5315cbf06..f5045abde45 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/30_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/30_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/40_routing.yaml.cs index 886cbc2a8a2..e126ecd6fe2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/55_parent_with_routing.yaml.cs index af39a8b5e16..d219a5350e2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/60_realtime_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/60_realtime_refresh.yaml.cs index 287c48dc759..ee21a687545 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/60_realtime_refresh.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/60_realtime_refresh.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/70_defaults.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/70_defaults.yaml.cs index a37f2707f80..82a7b059ba1 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/70_defaults.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/exists/70_defaults.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/10_basic.yaml.cs index 2b0671bc378..5cf84ce0891 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/20_source_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/20_source_filtering.yaml.cs index 28bbc02b96d..abcc43d407d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/20_source_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/explain/20_source_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/10_basic.yaml.cs index 3e793c0089a..4a86d2c78d1 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/10_basic.yaml.cs @@ -1,6 +1,9 @@ -using System; +using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -19,7 +22,7 @@ public void Basic1Test() //do index _body = new { - foo= "Hello= 中文" + foo= "Hello= 中文" }; this.Do(()=> _client.Index("test_1", "test", "中文", _body)); @@ -37,7 +40,7 @@ public void Basic1Test() //match _response._source: this.IsMatch(_response._source, new { - foo= "Hello= 中文" + foo= "Hello= 中文" }); //do get @@ -54,7 +57,7 @@ public void Basic1Test() //match _response._source: this.IsMatch(_response._source, new { - foo= "Hello= 中文" + foo= "Hello= 中文" }); } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/15_default_values.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/15_default_values.yaml.cs index ec809df1b75..9a0c9e89712 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/15_default_values.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/15_default_values.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/20_fields.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/20_fields.yaml.cs index 2f074fce09d..3a497f5905a 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/20_fields.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/20_fields.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -61,7 +64,7 @@ public void Fields1Test() //match _response.fields.count: this.IsMatch(_response.fields.count, new [] { - @"1" + 1 }); //is_false _response._source; @@ -83,7 +86,7 @@ public void Fields1Test() //match _response.fields.count: this.IsMatch(_response.fields.count, new [] { - @"1" + 1 }); //match _response._source.foo: diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/30_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/30_parent.yaml.cs index e9f3ca2ca07..dd6f99ac59d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/30_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/30_parent.yaml.cs @@ -1,6 +1,9 @@ -using System; +using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/40_routing.yaml.cs index 814277fb6c9..5db35bc24e6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/55_parent_with_routing.yaml.cs index ad6c894a3fd..931824bde4c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/60_realtime_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/60_realtime_refresh.yaml.cs index 3e12a1071d2..0a308d4e29c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/60_realtime_refresh.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/60_realtime_refresh.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/70_source_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/70_source_filtering.yaml.cs index 3b27f9096c1..98ef1857494 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/70_source_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/70_source_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -120,7 +123,7 @@ public void SourceFiltering1Test() //match _response.fields.count: this.IsMatch(_response.fields.count, new [] { - @"1" + 1 }); //match _response._source.include.field1: diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/80_missing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/80_missing.yaml.cs index 9c67985715d..b41c0b46769 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/80_missing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/80_missing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/90_versions.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/90_versions.yaml.cs index e6dbce4c87d..1793b38b1d1 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get/90_versions.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get/90_versions.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/10_basic.yaml.cs index 2a1eb8a2fa6..8b26b02fa8c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/15_default_values.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/15_default_values.yaml.cs index d02f0b69654..aebd76c3d27 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/15_default_values.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/15_default_values.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/30_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/30_parent.yaml.cs index 7987801ab0c..3477630d305 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/30_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/30_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/40_routing.yaml.cs index 2b4734b407b..38517cd9728 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/55_parent_with_routing.yaml.cs index 9376d11d70d..e33a5922665 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/60_realtime_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/60_realtime_refresh.yaml.cs index ac177719217..e67139f128a 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/60_realtime_refresh.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/60_realtime_refresh.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/70_source_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/70_source_filtering.yaml.cs index ba1a10f86c8..5cf98206d14 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/70_source_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/70_source_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/80_missing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/80_missing.yaml.cs index e50c3311151..4922fd899ec 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/80_missing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/get_source/80_missing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/10_with_id.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/10_with_id.yaml.cs index 362d9e9f6cc..9e8c637262f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/10_with_id.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/10_with_id.yaml.cs @@ -1,6 +1,9 @@ -using System; +using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/15_without_id.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/15_without_id.yaml.cs index 7abcade5834..db22e9054a8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/15_without_id.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/15_without_id.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/20_optype.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/20_optype.yaml.cs index 848493ecb5f..d2cce1015bc 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/20_optype.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/20_optype.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/30_internal_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/30_internal_version.yaml.cs index 3791c3131a1..29f2e55645e 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/30_internal_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/30_internal_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/35_external_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/35_external_version.yaml.cs index 37c6f0f3079..988a57bfc6c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/35_external_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/35_external_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/36_external_gte_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/36_external_gte_version.yaml.cs index b6568605997..429fb588ffb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/36_external_gte_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/36_external_gte_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/37_force_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/37_force_version.yaml.cs index c609160a5a6..4c5becf1ad8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/37_force_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/37_force_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/40_routing.yaml.cs index 4a408ec3289..d7082ad1e28 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/50_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/50_parent.yaml.cs index 66bfefa9e3e..5fd29f7bd2b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/50_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/50_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/55_parent_with_routing.yaml.cs index 1c933cd5728..cef8978bb51 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/60_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/60_refresh.yaml.cs deleted file mode 100644 index 5b851fc6330..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/60_refresh.yaml.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.Index11 -{ - public partial class Index11YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class Refresh1Tests : YamlTestsBase - { - [Test] - public void Refresh1Test() - { - - //do indices.create - _body = new { - settings= new Dictionary { - { "index.refresh_interval", "-1" } - } - }; - this.Do(()=> _client.IndicesCreate("test_1", _body)); - - //do cluster.health - this.Do(()=> _client.ClusterHealth(nv=>nv - .AddQueryString("wait_for_status", @"yellow") - )); - - //do index - _body = new { - foo= "bar" - }; - this.Do(()=> _client.Index("test_1", "test", "1", _body)); - - //do search - _body = new { - query= new { - term= new { - _id= "1" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 0); - - //do index - _body = new { - foo= "bar" - }; - this.Do(()=> _client.Index("test_1", "test", "2", _body, nv=>nv - .AddQueryString("refresh", 1) - )); - - //do search - _body = new { - query= new { - term= new { - _id= "2" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 1); - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/70_timestamp.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/70_timestamp.yaml.cs index 732bf2514c0..7768b4bbe26 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/70_timestamp.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/70_timestamp.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -54,7 +57,7 @@ public void Timestamp1Test() foo= "bar" }; this.Do(()=> _client.Index("test_1", "test", "1", _body, nv=>nv - .AddQueryString("timestamp", @"1372011280000") + .AddQueryString("timestamp", 1372011280000) )); //do get @@ -63,7 +66,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); //do index _body = new { @@ -79,7 +82,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/75_ttl.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/75_ttl.yaml.cs index 6621bfa4c9c..f26c24241cb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/index/75_ttl.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/index/75_ttl.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.analyze/10_analyze.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.analyze/10_analyze.yaml.cs index d8ee7570ac5..b8bdbe8e290 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.analyze/10_analyze.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.analyze/10_analyze.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.clear_cache/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.clear_cache/10_basic.yaml.cs index a18e6b66761..6da8ce6b0ff 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.clear_cache/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.clear_cache/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.create/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.create/10_basic.yaml.cs index 97fa6c44d86..83aa5f07057 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.create/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.create/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/10_basic.yaml.cs index 7e036e7268e..1b5d26174d8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/all_path_options.yaml.cs index 4add3aa1677..b203ed0a25c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_alias/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/10_basic.yaml.cs index a3f11782706..efda091c9bb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/all_path_options.yaml.cs index a1622520726..f15c45878bb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_mapping/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_warmer/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_warmer/all_path_options.yaml.cs index 3d0364a954c..241a20bcc98 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_warmer/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.delete_warmer/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists/10_basic.yaml.cs index 36df1d3978f..2468da353b3 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_alias/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_alias/10_basic.yaml.cs index 11146c6f64f..b6a421a74bc 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_alias/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_alias/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_template/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_template/10_basic.yaml.cs index 9cdb433a09e..6ef420e55a5 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_template/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_template/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -17,7 +20,7 @@ public IndicesExistsTemplate110BasicYamlBase() : base() //do indices.delete_template this.Do(()=> _client.IndicesDeleteTemplateForAll("test", nv=>nv .AddQueryString("ignore", new [] { - @"404" + 404 }) )); diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_type/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_type/10_basic.yaml.cs index 8e3e6cad2a3..23b17a00231 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_type/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.exists_type/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_alias/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_alias/10_basic.yaml.cs index 9d7c0c9f79c..7f2b7f35cc2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_alias/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_alias/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_aliases/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_aliases/10_basic.yaml.cs index 12ca30b9f78..d639ea0aa64 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_aliases/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_aliases/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/10_basic.yaml.cs index 66962a57468..0554a496210 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/20_missing_field.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/20_missing_field.yaml.cs index b77aa28c79e..7dcca247874 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/20_missing_field.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/20_missing_field.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/30_missing_type.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/30_missing_type.yaml.cs index 102dd3077da..3355b6a10ae 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/30_missing_type.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/30_missing_type.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/40_missing_index.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/40_missing_index.yaml.cs index b11ca8236d6..88556997420 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/40_missing_index.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/40_missing_index.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/50_field_wildcards.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/50_field_wildcards.yaml.cs index 88c8357aacd..9cc69186554 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/50_field_wildcards.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_field_mapping/50_field_wildcards.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/10_basic.yaml.cs index e247177f111..f0e28363731 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/20_missing_type.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/20_missing_type.yaml.cs index 92a2c5e86a4..db5fecae1ae 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/20_missing_type.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/20_missing_type.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/30_missing_index.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/30_missing_index.yaml.cs index dc0ff6ffd78..f02b1d32ca5 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/30_missing_index.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/30_missing_index.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/40_aliases.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/40_aliases.yaml.cs index 539d1c5fb7b..3854f583a67 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/40_aliases.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_mapping/40_aliases.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/10_basic.yaml.cs index 7a81659493b..c9b9b46c02f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/20_aliases.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/20_aliases.yaml.cs index 005eda41eeb..e0e3e9f36e8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/20_aliases.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_settings/20_aliases.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/10_basic.yaml.cs index fa17fa53b17..6978eebb56f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -43,8 +46,8 @@ public void GetTemplate2Test() //match _response.test.settings: this.IsMatch(_response.test.settings, new Dictionary { - { @"index.number_of_shards", @"1" }, - { @"index.number_of_replicas", @"0" } + { @"index.number_of_shards", 1 }, + { @"index.number_of_replicas", 0 } }); } @@ -95,6 +98,29 @@ public void GetTemplateWithLocalFlag4Test() } } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GetTemplateWithNonFlatSettings5Tests : IndicesGetTemplate110BasicYamlBase + { + [Test] + public void GetTemplateWithNonFlatSettings5Test() + { + + //do indices.get_template + this.Do(()=> _client.IndicesGetTemplateForAll("test", nv=>nv + .AddQueryString("flat_settings", @"false") + )); + + //match _response.test.settings: + this.IsMatch(_response.test.settings, new { + index= new { + number_of_shards= "1", + number_of_replicas= "0" + } + }); + + } + } } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/20_get_missing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/20_get_missing.yaml.cs index 649b79283ca..f877fe5fde6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/20_get_missing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_template/20_get_missing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_warmer/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_warmer/10_basic.yaml.cs index 0549e7e57b2..edf07ea1fe2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_warmer/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.get_warmer/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/10_basic.yaml.cs index 37b3404709d..e00f2adb520 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/20_multiple_indices.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/20_multiple_indices.yaml.cs index e56a9b36dbf..fa76a0f2549 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/20_multiple_indices.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.open/20_multiple_indices.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.optimize/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.optimize/10_basic.yaml.cs index 48a4a357cd1..6b40169433b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.optimize/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.optimize/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/10_basic.yaml.cs index 7bb7a0ae5b7..5efcea3e602 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/all_path_options.yaml.cs index 227f11d38f1..3fea514656d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_alias/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/10_basic.yaml.cs index aeaad4a05e5..a87f8b653eb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/all_path_options.yaml.cs index 09dd2d2e20c..31989550f97 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_mapping/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/10_basic.yaml.cs index d0dcc1707ee..7b5add58389 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/all_path_options.yaml.cs index cdb26694d61..ea4e493508d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_settings/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_template/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_template/10_basic.yaml.cs index 2b9756041d5..27671d6c7e0 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_template/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_template/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -35,8 +38,8 @@ public void PutTemplate1Test() //match _response.test.settings: this.IsMatch(_response.test.settings, new Dictionary { - { @"index.number_of_shards", @"1" }, - { @"index.number_of_replicas", @"0" } + { @"index.number_of_shards", 1 }, + { @"index.number_of_replicas", 0 } }); } @@ -91,6 +94,52 @@ public void PutTemplateWithAliases2Test() } } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class PutTemplateCreate3Tests : YamlTestsBase + { + [Test] + public void PutTemplateCreate3Test() + { + + //do indices.put_template + _body = new { + template= "test-*", + settings= new { + number_of_shards= "1", + number_of_replicas= "0" + } + }; + this.Do(()=> _client.IndicesPutTemplateForAll("test", _body, nv=>nv + .AddQueryString("create", @"true") + )); + + //do indices.get_template + this.Do(()=> _client.IndicesGetTemplateForAll("test")); + + //match _response.test.template: + this.IsMatch(_response.test.template, @"test-*"); + + //match _response.test.settings: + this.IsMatch(_response.test.settings, new Dictionary { + { @"index.number_of_shards", 1 }, + { @"index.number_of_replicas", 0 } + }); + + //do indices.put_template + _body = new { + template= "test-*", + settings= new { + number_of_shards= "1", + number_of_replicas= "0" + } + }; + this.Do(()=> _client.IndicesPutTemplateForAll("test", _body, nv=>nv + .AddQueryString("create", @"true") + ), shouldCatch: @"request"); + + } + } } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/10_basic.yaml.cs index a280852ca83..6c4f94602ef 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/20_aliases.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/20_aliases.yaml.cs index 519dea35270..0242f0637d5 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/20_aliases.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/20_aliases.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/all_path_options.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/all_path_options.yaml.cs index 6b7eaeab60c..a8fb93db50e 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/all_path_options.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.put_warmer/all_path_options.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.recovery/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.recovery/10_basic.yaml.cs index d31a4b230e5..c2378d54cb6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.recovery/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.recovery/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.segments/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.segments/10_basic.yaml.cs index e906dcdc7fc..c67e7f457a8 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.segments/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.segments/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.snapshot_index/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.snapshot_index/10_basic.yaml.cs deleted file mode 100644 index acd1cdcd89d..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.snapshot_index/10_basic.yaml.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.IndicesSnapshotIndex1 -{ - public partial class IndicesSnapshotIndex1YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class SnapshotIndexTest1Tests : YamlTestsBase - { - [Test] - public void SnapshotIndexTest1Test() - { - - //do indices.snapshot_index - - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_basic.yaml.cs deleted file mode 100644 index 10c86109447..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_basic.yaml.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.IndicesStats1 -{ - public partial class IndicesStats1YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class StatsTest1Tests : YamlTestsBase - { - [Test] - public void StatsTest1Test() - { - - //do indices.stats - this.Do(()=> _client.IndicesStatsForAll()); - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_index.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_index.yaml.cs new file mode 100644 index 00000000000..583300f2e6f --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/10_index.yaml.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats1 +{ + public partial class IndicesStats1YamlTests + { + + public class IndicesStats110IndexYamlBase : YamlTestsBase + { + public IndicesStats110IndexYamlBase() : base() + { + + //do indices.create + _body = new { + settings= new { + number_of_shards= "5", + number_of_replicas= "1" + } + }; + this.Do(()=> _client.IndicesCreate("test1", _body)); + + //do indices.create + _body = new { + settings= new { + number_of_shards= "4", + number_of_replicas= "1" + } + }; + this.Do(()=> _client.IndicesCreate("test2", _body)); + + //do index + _body = new { + foo= "bar" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do index + _body = new { + foo= "baz" + }; + this.Do(()=> _client.Index("test2", "baz", "1", _body)); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexBlank2Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 18); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_true _response.indices.test1; + this.IsTrue(_response.indices.test1); + + //is_true _response.indices.test2; + this.IsTrue(_response.indices.test2); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexAll3Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexAll3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStats("_all")); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 18); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_true _response.indices.test1; + this.IsTrue(_response.indices.test1); + + //is_true _response.indices.test2; + this.IsTrue(_response.indices.test2); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexStar4Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexStar4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStats("*")); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 18); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_true _response.indices.test1; + this.IsTrue(_response.indices.test1); + + //is_true _response.indices.test2; + this.IsTrue(_response.indices.test2); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexOneIndex5Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexOneIndex5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStats("test1")); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 10); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_true _response.indices.test1; + this.IsTrue(_response.indices.test1); + + //is_false _response.indices.test2; + this.IsFalse(_response.indices.test2); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexMultiIndex6Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexMultiIndex6Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStats("test1,test2")); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 18); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_true _response.indices.test1; + this.IsTrue(_response.indices.test1); + + //is_true _response.indices.test2; + this.IsTrue(_response.indices.test2); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexPattern7Tests : IndicesStats110IndexYamlBase + { + [Test] + public void IndexPattern7Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStats("*2")); + + //match _response._shards.total: + this.IsMatch(_response._shards.total, 8); + + //is_true _response._all; + this.IsTrue(_response._all); + + //is_false _response.indices.test1; + this.IsFalse(_response.indices.test1); + + //is_true _response.indices.test2; + this.IsTrue(_response.indices.test2); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/11_metric.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/11_metric.yaml.cs new file mode 100644 index 00000000000..ef13943714d --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/11_metric.yaml.cs @@ -0,0 +1,293 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats2 +{ + public partial class IndicesStats2YamlTests + { + + public class IndicesStats211MetricYamlBase : YamlTestsBase + { + public IndicesStats211MetricYamlBase() : base() + { + + //do index + _body = new { + foo= "bar" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do index + _body = new { + foo= "baz" + }; + this.Do(()=> _client.Index("test2", "baz", "1", _body)); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class MetricBlank2Tests : IndicesStats211MetricYamlBase + { + [Test] + public void MetricBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.store; + this.IsTrue(_response._all.total.store); + + //is_true _response._all.total.indexing; + this.IsTrue(_response._all.total.indexing); + + //is_true _response._all.total.get; + this.IsTrue(_response._all.total.get); + + //is_true _response._all.total.search; + this.IsTrue(_response._all.total.search); + + //is_true _response._all.total.merges; + this.IsTrue(_response._all.total.merges); + + //is_true _response._all.total.refresh; + this.IsTrue(_response._all.total.refresh); + + //is_true _response._all.total.flush; + this.IsTrue(_response._all.total.flush); + + //is_true _response._all.total.warmer; + this.IsTrue(_response._all.total.warmer); + + //is_true _response._all.total.filter_cache; + this.IsTrue(_response._all.total.filter_cache); + + //is_true _response._all.total.id_cache; + this.IsTrue(_response._all.total.id_cache); + + //is_true _response._all.total.fielddata; + this.IsTrue(_response._all.total.fielddata); + + //is_true _response._all.total.percolate; + this.IsTrue(_response._all.total.percolate); + + //is_true _response._all.total.completion; + this.IsTrue(_response._all.total.completion); + + //is_true _response._all.total.segments; + this.IsTrue(_response._all.total.segments); + + //is_true _response._all.total.translog; + this.IsTrue(_response._all.total.translog); + + //is_true _response._all.total.suggest; + this.IsTrue(_response._all.total.suggest); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class MetricAll3Tests : IndicesStats211MetricYamlBase + { + [Test] + public void MetricAll3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all")); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.store; + this.IsTrue(_response._all.total.store); + + //is_true _response._all.total.indexing; + this.IsTrue(_response._all.total.indexing); + + //is_true _response._all.total.get; + this.IsTrue(_response._all.total.get); + + //is_true _response._all.total.search; + this.IsTrue(_response._all.total.search); + + //is_true _response._all.total.merges; + this.IsTrue(_response._all.total.merges); + + //is_true _response._all.total.refresh; + this.IsTrue(_response._all.total.refresh); + + //is_true _response._all.total.flush; + this.IsTrue(_response._all.total.flush); + + //is_true _response._all.total.warmer; + this.IsTrue(_response._all.total.warmer); + + //is_true _response._all.total.filter_cache; + this.IsTrue(_response._all.total.filter_cache); + + //is_true _response._all.total.id_cache; + this.IsTrue(_response._all.total.id_cache); + + //is_true _response._all.total.fielddata; + this.IsTrue(_response._all.total.fielddata); + + //is_true _response._all.total.percolate; + this.IsTrue(_response._all.total.percolate); + + //is_true _response._all.total.completion; + this.IsTrue(_response._all.total.completion); + + //is_true _response._all.total.segments; + this.IsTrue(_response._all.total.segments); + + //is_true _response._all.total.translog; + this.IsTrue(_response._all.total.translog); + + //is_true _response._all.total.suggest; + this.IsTrue(_response._all.total.suggest); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class MetricOne4Tests : IndicesStats211MetricYamlBase + { + [Test] + public void MetricOne4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("docs")); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_false _response._all.total.store; + this.IsFalse(_response._all.total.store); + + //is_false _response._all.total.indexing; + this.IsFalse(_response._all.total.indexing); + + //is_false _response._all.total.get; + this.IsFalse(_response._all.total.get); + + //is_false _response._all.total.search; + this.IsFalse(_response._all.total.search); + + //is_false _response._all.total.merges; + this.IsFalse(_response._all.total.merges); + + //is_false _response._all.total.refresh; + this.IsFalse(_response._all.total.refresh); + + //is_false _response._all.total.flush; + this.IsFalse(_response._all.total.flush); + + //is_false _response._all.total.warmer; + this.IsFalse(_response._all.total.warmer); + + //is_false _response._all.total.filter_cache; + this.IsFalse(_response._all.total.filter_cache); + + //is_false _response._all.total.id_cache; + this.IsFalse(_response._all.total.id_cache); + + //is_false _response._all.total.fielddata; + this.IsFalse(_response._all.total.fielddata); + + //is_false _response._all.total.percolate; + this.IsFalse(_response._all.total.percolate); + + //is_false _response._all.total.completion; + this.IsFalse(_response._all.total.completion); + + //is_false _response._all.total.segments; + this.IsFalse(_response._all.total.segments); + + //is_false _response._all.total.translog; + this.IsFalse(_response._all.total.translog); + + //is_false _response._all.total.suggest; + this.IsFalse(_response._all.total.suggest); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class MetricMulti5Tests : IndicesStats211MetricYamlBase + { + [Test] + public void MetricMulti5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("store,get,merge")); + + //is_false _response._all.total.docs; + this.IsFalse(_response._all.total.docs); + + //is_true _response._all.total.store; + this.IsTrue(_response._all.total.store); + + //is_false _response._all.total.indexing; + this.IsFalse(_response._all.total.indexing); + + //is_true _response._all.total.get; + this.IsTrue(_response._all.total.get); + + //is_false _response._all.total.search; + this.IsFalse(_response._all.total.search); + + //is_true _response._all.total.merges; + this.IsTrue(_response._all.total.merges); + + //is_false _response._all.total.refresh; + this.IsFalse(_response._all.total.refresh); + + //is_false _response._all.total.flush; + this.IsFalse(_response._all.total.flush); + + //is_false _response._all.total.warmer; + this.IsFalse(_response._all.total.warmer); + + //is_false _response._all.total.filter_cache; + this.IsFalse(_response._all.total.filter_cache); + + //is_false _response._all.total.id_cache; + this.IsFalse(_response._all.total.id_cache); + + //is_false _response._all.total.fielddata; + this.IsFalse(_response._all.total.fielddata); + + //is_false _response._all.total.percolate; + this.IsFalse(_response._all.total.percolate); + + //is_false _response._all.total.completion; + this.IsFalse(_response._all.total.completion); + + //is_false _response._all.total.segments; + this.IsFalse(_response._all.total.segments); + + //is_false _response._all.total.translog; + this.IsFalse(_response._all.total.translog); + + //is_false _response._all.total.suggest; + this.IsFalse(_response._all.total.suggest); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/12_level.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/12_level.yaml.cs new file mode 100644 index 00000000000..d496cc02be7 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/12_level.yaml.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats3 +{ + public partial class IndicesStats3YamlTests + { + + public class IndicesStats312LevelYamlBase : YamlTestsBase + { + public IndicesStats312LevelYamlBase() : base() + { + + //do index + _body = new { + foo= "bar" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do index + _body = new { + foo= "baz" + }; + this.Do(()=> _client.Index("test2", "baz", "1", _body)); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class LevelBlank2Tests : IndicesStats312LevelYamlBase + { + [Test] + public void LevelBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_false _response.indices.test1.shards; + this.IsFalse(_response.indices.test1.shards); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_false _response.indices.test2.shards; + this.IsFalse(_response.indices.test2.shards); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class LevelIndices3Tests : IndicesStats312LevelYamlBase + { + [Test] + public void LevelIndices3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("level", @"indices") + )); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_false _response.indices.test1.shards; + this.IsFalse(_response.indices.test1.shards); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_false _response.indices.test2.shards; + this.IsFalse(_response.indices.test2.shards); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class LevelCluster4Tests : IndicesStats312LevelYamlBase + { + [Test] + public void LevelCluster4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("level", @"cluster") + )); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_false _response.indices; + this.IsFalse(_response.indices); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class LevelShards5Tests : IndicesStats312LevelYamlBase + { + [Test] + public void LevelShards5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("level", @"shards") + )); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response._all.total.docs; + this.IsTrue(_response._all.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_true _response.indices.test1.total.docs; + this.IsTrue(_response.indices.test1.total.docs); + + //is_true _response.indices.test1.shards; + this.IsTrue(_response.indices.test1.shards); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_true _response.indices.test2.total.docs; + this.IsTrue(_response.indices.test2.total.docs); + + //is_true _response.indices.test2.shards; + this.IsTrue(_response.indices.test2.shards); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/13_fields.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/13_fields.yaml.cs new file mode 100644 index 00000000000..33b33c5653f --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/13_fields.yaml.cs @@ -0,0 +1,684 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats4 +{ + public partial class IndicesStats4YamlTests + { + + public class IndicesStats413FieldsYamlBase : YamlTestsBase + { + public IndicesStats413FieldsYamlBase() : base() + { + + //do indices.create + _body = new { + mappings= new { + bar= new { + properties= new { + bar= new { + type= "string", + fields= new { + completion= new { + type= "completion" + } + } + }, + baz= new { + type= "string", + fields= new { + completion= new { + type= "completion" + } + } + } + } + } + } + }; + this.Do(()=> _client.IndicesCreate("test1", _body)); + + //do index + _body = new { + bar= "bar", + baz= "baz" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do index + _body = new { + bar= "bar", + baz= "baz" + }; + this.Do(()=> _client.Index("test2", "baz", "1", _body)); + + //do indices.refresh + this.Do(()=> _client.IndicesRefreshForAll()); + + //do search + this.Do(()=> _client.SearchGet(nv=>nv + .AddQueryString("sort", @"bar,baz") + )); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsBlank2Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsOne3Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsOne3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fields", @"bar") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //is_false _response._all.total.completion.fields.bar; + this.IsFalse(_response._all.total.completion.fields.bar); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsMulti4Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsMulti4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fields", @"bar,baz.completion") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"]); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"], 0); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsStar5Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsStar5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fields", @"*") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.baz.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.baz.memory_size_in_bytes, 0); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"], 0); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsPattern6Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsPattern6Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fields", @"bar*") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsAllMetric7Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsAllMetric7Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all", nv=>nv + .AddQueryString("fields", @"bar*") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsFielddataMetric8Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsFielddataMetric8Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("fielddata", nv=>nv + .AddQueryString("fields", @"bar*") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion; + this.IsFalse(_response._all.total.completion); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsCompletionMetric9Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsCompletionMetric9Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("completion", nv=>nv + .AddQueryString("fields", @"bar*") + )); + + //is_false _response._all.total.fielddata; + this.IsFalse(_response._all.total.fielddata); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FieldsMultiMetric10Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FieldsMultiMetric10Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("completion,fielddata,search", nv=>nv + .AddQueryString("fields", @"bar*") + )); + + //gt _response._all.total.fielddata.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //gt _response._all.total.completion.size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.completion.size_in_bytes, 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsOne11Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsOne11Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fielddata_fields", @"bar") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsMulti12Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsMulti12Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fielddata_fields", @"bar,baz,baz.completion") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.baz.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.baz.memory_size_in_bytes, 0); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsStar13Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsStar13Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fielddata_fields", @"*") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //gt _response._all.total.fielddata.fields.baz.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.baz.memory_size_in_bytes, 0); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsPattern14Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsPattern14Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("fielddata_fields", @"*r") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsAllMetric15Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsAllMetric15Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all", nv=>nv + .AddQueryString("fielddata_fields", @"*r") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsOneMetric16Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsOneMetric16Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("fielddata", nv=>nv + .AddQueryString("fielddata_fields", @"*r") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FielddataFieldsMultiMetric17Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void FielddataFieldsMultiMetric17Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("fielddata,search", nv=>nv + .AddQueryString("fielddata_fields", @"*r") + )); + + //gt _response._all.total.fielddata.fields.bar.memory_size_in_bytes: 0; + this.IsGreaterThan(_response._all.total.fielddata.fields.bar.memory_size_in_bytes, 0); + + //is_false _response._all.total.fielddata.fields.baz; + this.IsFalse(_response._all.total.fielddata.fields.baz); + + //is_false _response._all.total.completion.fields; + this.IsFalse(_response._all.total.completion.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionFieldsOne18Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionFieldsOne18Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("completion_fields", @"bar.completion") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionFieldsMulti19Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionFieldsMulti19Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("completion_fields", @"bar.completion,baz,baz.completion") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"], 0); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionFieldsStar20Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionFieldsStar20Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("completion_fields", @"*") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"][@"size_in_bytes"], 0); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionPattern21Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionPattern21Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("completion_fields", @"*r*") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionAllMetric22Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionAllMetric22Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all", nv=>nv + .AddQueryString("completion_fields", @"*r*") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionOneMetric23Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionOneMetric23Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("completion", nv=>nv + .AddQueryString("completion_fields", @"*r*") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class CompletionMultiMetric24Tests : IndicesStats413FieldsYamlBase + { + [Test] + public void CompletionMultiMetric24Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("completion,search", nv=>nv + .AddQueryString("completion_fields", @"*r*") + )); + + //gt _response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"]: 0; + this.IsGreaterThan(_response[@"_all"][@"total"][@"completion"][@"fields"][@"bar.completion"][@"size_in_bytes"], 0); + + //is_false _response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]; + this.IsFalse(_response[@"_all"][@"total"][@"completion"][@"fields"][@"baz.completion"]); + + //is_false _response._all.total.fielddata.fields; + this.IsFalse(_response._all.total.fielddata.fields); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/14_groups.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/14_groups.yaml.cs new file mode 100644 index 00000000000..6af2fd300e3 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/14_groups.yaml.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats5 +{ + public partial class IndicesStats5YamlTests + { + + public class IndicesStats514GroupsYamlBase : YamlTestsBase + { + public IndicesStats514GroupsYamlBase() : base() + { + + //do index + _body = new { + bar= "bar", + baz= "baz" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do search + _body = new { + stats= new [] { + "bar", + "baz" + } + }; + this.Do(()=> _client.Search(_body)); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsBlank2Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //gt _response._all.total.search.query_total: 0; + this.IsGreaterThan(_response._all.total.search.query_total, 0); + + //is_false _response._all.total.search.groups; + this.IsFalse(_response._all.total.search.groups); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsOne3Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsOne3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("groups", @"bar") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //is_false _response._all.total.search.groups.baz; + this.IsFalse(_response._all.total.search.groups.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsMulti4Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsMulti4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("groups", @"bar,baz") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //gt _response._all.total.search.groups.baz.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.baz.query_total, 0); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsStar5Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsStar5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("groups", @"*") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //gt _response._all.total.search.groups.baz.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.baz.query_total, 0); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsPattern6Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsPattern6Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("groups", @"*r") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //is_false _response._all.total.search.groups.baz; + this.IsFalse(_response._all.total.search.groups.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsAllMetric7Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsAllMetric7Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all", nv=>nv + .AddQueryString("groups", @"bar") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //is_false _response._all.total.search.groups.baz; + this.IsFalse(_response._all.total.search.groups.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsSearchMetric8Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsSearchMetric8Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("search", nv=>nv + .AddQueryString("groups", @"bar") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //is_false _response._all.total.search.groups.baz; + this.IsFalse(_response._all.total.search.groups.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class GroupsMultiMetric9Tests : IndicesStats514GroupsYamlBase + { + [Test] + public void GroupsMultiMetric9Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("indexing,search", nv=>nv + .AddQueryString("groups", @"bar") + )); + + //gt _response._all.total.search.groups.bar.query_total: 0; + this.IsGreaterThan(_response._all.total.search.groups.bar.query_total, 0); + + //is_false _response._all.total.search.groups.baz; + this.IsFalse(_response._all.total.search.groups.baz); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/15_types.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/15_types.yaml.cs new file mode 100644 index 00000000000..df8de2f0e58 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.stats/15_types.yaml.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.IndicesStats6 +{ + public partial class IndicesStats6YamlTests + { + + public class IndicesStats615TypesYamlBase : YamlTestsBase + { + public IndicesStats615TypesYamlBase() : base() + { + + //do index + _body = new { + bar= "bar", + baz= "baz" + }; + this.Do(()=> _client.Index("test1", "bar", "1", _body)); + + //do index + _body = new { + bar= "bar", + baz= "baz" + }; + this.Do(()=> _client.Index("test2", "baz", "1", _body)); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesBlank2Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesBlank2Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll()); + + //match _response._all.primaries.indexing.index_total: + this.IsMatch(_response._all.primaries.indexing.index_total, 2); + + //is_false _response._all.primaries.indexing.types; + this.IsFalse(_response._all.primaries.indexing.types); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesOne3Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesOne3Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("types", @"bar") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //is_false _response._all.primaries.indexing.types.baz; + this.IsFalse(_response._all.primaries.indexing.types.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesMulti4Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesMulti4Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("types", @"bar,baz") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //match _response._all.primaries.indexing.types.baz.index_total: + this.IsMatch(_response._all.primaries.indexing.types.baz.index_total, 1); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesStar5Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesStar5Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("types", @"*") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //match _response._all.primaries.indexing.types.baz.index_total: + this.IsMatch(_response._all.primaries.indexing.types.baz.index_total, 1); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesPattern6Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesPattern6Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll(nv=>nv + .AddQueryString("types", @"*r") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //is_false _response._all.primaries.indexing.types.baz; + this.IsFalse(_response._all.primaries.indexing.types.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesAllMetric7Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesAllMetric7Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("_all", nv=>nv + .AddQueryString("types", @"bar") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //is_false _response._all.primaries.indexing.types.baz; + this.IsFalse(_response._all.primaries.indexing.types.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesIndexingMetric8Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesIndexingMetric8Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("indexing", nv=>nv + .AddQueryString("types", @"bar") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //is_false _response._all.primaries.indexing.types.baz; + this.IsFalse(_response._all.primaries.indexing.types.baz); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class TypesMultiMetric9Tests : IndicesStats615TypesYamlBase + { + [Test] + public void TypesMultiMetric9Test() + { + + //do indices.stats + this.Do(()=> _client.IndicesStatsForAll("indexing,search", nv=>nv + .AddQueryString("types", @"bar") + )); + + //match _response._all.primaries.indexing.types.bar.index_total: + this.IsMatch(_response._all.primaries.indexing.types.bar.index_total, 1); + + //is_false _response._all.primaries.indexing.types.baz; + this.IsFalse(_response._all.primaries.indexing.types.baz); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.status/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.status/10_basic.yaml.cs index 0f9599c64a8..12bb95c3048 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.status/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.status/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/10_basic.yaml.cs index cfa0714112a..d0118c0da35 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/20_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/20_routing.yaml.cs index e74e708ea01..fa4e25b9872 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/20_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.update_aliases/20_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.validate_query/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.validate_query/10_basic.yaml.cs index da3173ab541..45ee748bf92 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.validate_query/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/indices.validate_query/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/info/10_info.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/info/10_info.yaml.cs index 05e3804545c..e596416efb9 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/info/10_info.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/info/10_info.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/info/20_lucene_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/info/20_lucene_version.yaml.cs index bb53ae86c07..273ecba6dc5 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/info/20_lucene_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/info/20_lucene_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/10_basic.yaml.cs index 1840e8c9f59..b9eb19e93ff 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/11_default_index_type.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/11_default_index_type.yaml.cs index 0b0b989a972..862ea911394 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/11_default_index_type.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/11_default_index_type.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/12_non_existent_index.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/12_non_existent_index.yaml.cs index 26aff0b14e8..03ef4a5080d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/12_non_existent_index.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/12_non_existent_index.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/13_missing_metadata.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/13_missing_metadata.yaml.cs index 220724ba68e..e06c6725117 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/13_missing_metadata.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/13_missing_metadata.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/15_ids.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/15_ids.yaml.cs index 88ae0ea3fbd..a0e11ce96e9 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/15_ids.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/15_ids.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/20_fields.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/20_fields.yaml.cs index a5a2b583267..b0eb5c951c7 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/20_fields.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/20_fields.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/30_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/30_parent.yaml.cs index 3d150e1fc3c..ed5d87c3b32 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/30_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/30_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/40_routing.yaml.cs index 2f329c0ac35..9f693d0d42a 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/55_parent_with_routing.yaml.cs index 229bd8ffafb..aa4fe493ee6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/60_realtime_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/60_realtime_refresh.yaml.cs index 0364cf656dc..71d2c43b92e 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/60_realtime_refresh.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/60_realtime_refresh.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/70_source_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/70_source_filtering.yaml.cs index d14465a5e0b..cff99e5b884 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/70_source_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mget/70_source_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mlt/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mlt/10_basic.yaml.cs index 94db175ed62..18807c40dc6 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mlt/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mlt/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mpercolate/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mpercolate/10_basic.yaml.cs index 401107793ef..5634bc48ca2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mpercolate/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mpercolate/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/msearch/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/msearch/10_basic.yaml.cs index 00301624004..e2c4585cd1e 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/msearch/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/msearch/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/mtermvectors/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/mtermvectors/10_basic.yaml.cs index 8546d386bf9..3639fda8613 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/mtermvectors/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/mtermvectors/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.info/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.info/10_basic.yaml.cs index 9fe70cf672a..e87f07270eb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.info/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.info/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.stats/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.stats/10_basic.yaml.cs index bde15f2634c..b03fae937fa 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.stats/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/nodes.stats/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/15_new.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/15_new.yaml.cs index 20c9fdca692..ea9653f9d2d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/15_new.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/15_new.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/16_existing_doc.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/16_existing_doc.yaml.cs index 98f333a0f20..2d87fbbbdeb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/16_existing_doc.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/16_existing_doc.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/17_empty.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/17_empty.yaml.cs index a11ccc520c0..33b9a12519f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/17_empty.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/17_empty.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/18_highligh_with_query.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/18_highligh_with_query.yaml.cs index 914af2d105f..1e4f83ffe68 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/18_highligh_with_query.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/percolate/18_highligh_with_query.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/ping/10_ping.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/ping/10_ping.yaml.cs index 51373322a03..d78f4d4258f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/ping/10_ping.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/ping/10_ping.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/script/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/script/10_basic.yaml.cs new file mode 100644 index 00000000000..84adec2fc8a --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/script/10_basic.yaml.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.Script1 +{ + public partial class Script1YamlTests + { + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexedScript1Tests : YamlTestsBase + { + [Test] + public void IndexedScript1Test() + { + + //do put_script + _body = new { + script= "_score * docnew [] {\"myParent.weight\"}.value" + }; + + + //match _response._id: + this.IsMatch(_response._id, 1); + + //do get_script + + + //match _response.script: + this.IsMatch(_response.script, @"_score * doc[""myParent.weight""].value"); + + //do delete_script + + + //match _response.found: + this.IsMatch(_response.found, @"true"); + + //match _response._index: + this.IsMatch(_response._index, @".scripts"); + + //match _response._id: + this.IsMatch(_response._id, 1); + + //do put_script + _body = new { + script= "_score * foo bar + docnew [] {\"myParent.weight\"}.value" + }; + + + //do put_script + _body = new { + script= "_score * foo bar + docnew [] {\"myParent.weight\"}.value" + }; + + + //do put_script + _body = new { + script= "_score * docnew [] {\"myParent.weight\"}.value" + }; + + + //do put_script + _body = new { + script= "_score * docnew [] {\"myParent.weight\"}.value" + }; + + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/10_basic.yaml.cs index 826e4d882b3..3bd5a1cda91 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/11_clear.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/11_clear.yaml.cs index 850ccccc2dc..961ec70e9bb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/11_clear.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/scroll/11_clear.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -23,7 +26,7 @@ public void ClearScroll1Test() //do index _body = new { foo= "bar" - }; + }; this.Do(()=> _client.Index("test_scroll", "test", "42", _body)); //do indices.refresh @@ -34,7 +37,7 @@ public void ClearScroll1Test() query= new { match_all= new {} } - }; + }; this.Do(()=> _client.Search("test_scroll", _body, nv=>nv .AddQueryString("search_type", @"scan") .AddQueryString("scroll", @"1m") @@ -44,13 +47,13 @@ public void ClearScroll1Test() var scroll_id1 = _response._scroll_id; //do clear_scroll - this.Do(()=> _client.ClearScroll((string)scroll_id1, new {})); + this.Do(()=> _client.ClearScroll((string)scroll_id1, null)); //do scroll this.Do(()=> _client.ScrollGet((string)scroll_id1), shouldCatch: @"missing"); //do clear_scroll - this.Do(()=> _client.ClearScroll((string)scroll_id1, new {}), shouldCatch: @"missing"); + this.Do(()=> _client.ClearScroll((string)scroll_id1, null), shouldCatch: @"missing"); } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/search.aggregation/10_histogram.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/search.aggregation/10_histogram.yaml.cs new file mode 100644 index 00000000000..c6adcbf5cd6 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/search.aggregation/10_histogram.yaml.cs @@ -0,0 +1,232 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.SearchAggregation1 +{ + public partial class SearchAggregation1YamlTests + { + + public class SearchAggregation110HistogramYamlBase : YamlTestsBase + { + public SearchAggregation110HistogramYamlBase() : base() + { + + //do indices.create + _body = new { + settings= new { + number_of_replicas= "0" + }, + mappings= new { + test= new { + properties= new { + number= new { + type= "integer" + } + } + } + } + }; + this.Do(()=> _client.IndicesCreate("test_1", _body)); + + //do cluster.health + this.Do(()=> _client.ClusterHealth(nv=>nv + .AddQueryString("wait_for_status", @"green") + )); + + } + } + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class BasicTest2Tests : SearchAggregation110HistogramYamlBase + { + [Test] + public void BasicTest2Test() + { + + //do index + _body = new { + number= "1" + }; + this.Do(()=> _client.Index("test_1", "test", "1", _body)); + + //do index + _body = new { + number= "51" + }; + this.Do(()=> _client.Index("test_1", "test", "2", _body)); + + //do index + _body = new { + number= "101" + }; + this.Do(()=> _client.Index("test_1", "test", "3", _body)); + + //do index + _body = new { + number= "151" + }; + this.Do(()=> _client.Index("test_1", "test", "4", _body)); + + //do indices.refresh + this.Do(()=> _client.IndicesRefreshForAll()); + + //do search + _body = new { + aggs= new { + histo= new { + histogram= new { + field= "number", + interval= "50" + } + } + } + }; + this.Do(()=> _client.Search(_body)); + + //match _response.hits.total: + this.IsMatch(_response.hits.total, 4); + + //length _response.aggregations.histo.buckets: 4; + this.IsLength(_response.aggregations.histo.buckets, 4); + + //match _response.aggregations.histo.buckets[0].key: + this.IsMatch(_response.aggregations.histo.buckets[0].key, 0); + + //is_false _response.aggregations.histo.buckets[0].key_as_string; + this.IsFalse(_response.aggregations.histo.buckets[0].key_as_string); + + //match _response.aggregations.histo.buckets[0].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[0].doc_count, 1); + + //match _response.aggregations.histo.buckets[1].key: + this.IsMatch(_response.aggregations.histo.buckets[1].key, 50); + + //is_false _response.aggregations.histo.buckets[1].key_as_string; + this.IsFalse(_response.aggregations.histo.buckets[1].key_as_string); + + //match _response.aggregations.histo.buckets[1].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[1].doc_count, 1); + + //match _response.aggregations.histo.buckets[2].key: + this.IsMatch(_response.aggregations.histo.buckets[2].key, 100); + + //is_false _response.aggregations.histo.buckets[2].key_as_string; + this.IsFalse(_response.aggregations.histo.buckets[2].key_as_string); + + //match _response.aggregations.histo.buckets[2].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[2].doc_count, 1); + + //match _response.aggregations.histo.buckets[3].key: + this.IsMatch(_response.aggregations.histo.buckets[3].key, 150); + + //is_false _response.aggregations.histo.buckets[3].key_as_string; + this.IsFalse(_response.aggregations.histo.buckets[3].key_as_string); + + //match _response.aggregations.histo.buckets[3].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[3].doc_count, 1); + + } + } + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class FormatTest3Tests : SearchAggregation110HistogramYamlBase + { + [Test] + public void FormatTest3Test() + { + + //do index + _body = new { + number= "1" + }; + this.Do(()=> _client.Index("test_1", "test", "1", _body)); + + //do index + _body = new { + number= "51" + }; + this.Do(()=> _client.Index("test_1", "test", "2", _body)); + + //do index + _body = new { + number= "101" + }; + this.Do(()=> _client.Index("test_1", "test", "3", _body)); + + //do index + _body = new { + number= "151" + }; + this.Do(()=> _client.Index("test_1", "test", "4", _body)); + + //do indices.refresh + this.Do(()=> _client.IndicesRefreshForAll()); + + //do search + _body = new { + aggs= new { + histo= new { + histogram= new { + field= "number", + interval= "50", + format= "Value is ##0.0" + } + } + } + }; + this.Do(()=> _client.Search(_body)); + + //match _response.hits.total: + this.IsMatch(_response.hits.total, 4); + + //length _response.aggregations.histo.buckets: 4; + this.IsLength(_response.aggregations.histo.buckets, 4); + + //match _response.aggregations.histo.buckets[0].key: + this.IsMatch(_response.aggregations.histo.buckets[0].key, 0); + + //match _response.aggregations.histo.buckets[0].key_as_string: + this.IsMatch(_response.aggregations.histo.buckets[0].key_as_string, @"Value is 0.0"); + + //match _response.aggregations.histo.buckets[0].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[0].doc_count, 1); + + //match _response.aggregations.histo.buckets[1].key: + this.IsMatch(_response.aggregations.histo.buckets[1].key, 50); + + //match _response.aggregations.histo.buckets[1].key_as_string: + this.IsMatch(_response.aggregations.histo.buckets[1].key_as_string, @"Value is 50.0"); + + //match _response.aggregations.histo.buckets[1].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[1].doc_count, 1); + + //match _response.aggregations.histo.buckets[2].key: + this.IsMatch(_response.aggregations.histo.buckets[2].key, 100); + + //match _response.aggregations.histo.buckets[2].key_as_string: + this.IsMatch(_response.aggregations.histo.buckets[2].key_as_string, @"Value is 100.0"); + + //match _response.aggregations.histo.buckets[2].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[2].doc_count, 1); + + //match _response.aggregations.histo.buckets[3].key: + this.IsMatch(_response.aggregations.histo.buckets[3].key, 150); + + //match _response.aggregations.histo.buckets[3].key_as_string: + this.IsMatch(_response.aggregations.histo.buckets[3].key_as_string, @"Value is 150.0"); + + //match _response.aggregations.histo.buckets[3].doc_count: + this.IsMatch(_response.aggregations.histo.buckets[3].doc_count, 1); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/10_source_filtering.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/10_source_filtering.yaml.cs index 96e391a4c9a..c4de3901e33 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/10_source_filtering.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/10_source_filtering.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/20_default_values.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/20_default_values.yaml.cs index a300e722729..213290be249 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/20_default_values.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/20_default_values.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/issue4895.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/issue4895.yaml.cs index 65ef58717d3..943122293dc 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/issue4895.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/issue4895.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/search/test_sig_terms.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/test_sig_terms.yaml.cs new file mode 100644 index 00000000000..de3f9cc5471 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/search/test_sig_terms.yaml.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.Search6 +{ + public partial class Search6YamlTests + { + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class DefaultIndex1Tests : YamlTestsBase + { + [Test] + public void DefaultIndex1Test() + { + + //do indices.create + _body = new { + settings= new { + number_of_shards= "1" + } + }; + this.Do(()=> _client.IndicesCreate("goodbad", _body)); + + //do index + _body = new { + text= "good", + @class= "good" + }; + this.Do(()=> _client.Index("goodbad", "doc", "1", _body)); + + //do index + _body = new { + text= "good", + @class= "good" + }; + this.Do(()=> _client.Index("goodbad", "doc", "2", _body)); + + //do index + _body = new { + text= "bad", + @class= "bad" + }; + this.Do(()=> _client.Index("goodbad", "doc", "3", _body)); + + //do index + _body = new { + text= "bad", + @class= "bad" + }; + this.Do(()=> _client.Index("goodbad", "doc", "4", _body)); + + //do index + _body = new { + text= "good bad", + @class= "good" + }; + this.Do(()=> _client.Index("goodbad", "doc", "5", _body)); + + //do index + _body = new { + text= "good bad", + @class= "bad" + }; + this.Do(()=> _client.Index("goodbad", "doc", "6", _body)); + + //do index + _body = new { + text= "bad", + @class= "bad" + }; + this.Do(()=> _client.Index("goodbad", "doc", "7", _body)); + + //do indices.refresh + this.Do(()=> _client.IndicesRefresh("goodbad")); + + //do search + this.Do(()=> _client.SearchGet("goodbad", "doc")); + + //match _response.hits.total: + this.IsMatch(_response.hits.total, 7); + + //do search + _body = new { + aggs= new { + @class= new { + terms= new { + field= "class" + }, + aggs= new { + sig_terms= new { + significant_terms= new { + field= "text" + } + } + } + } + } + }; + this.Do(()=> _client.Search("goodbad", "doc", _body)); + + //match _response.aggregations.@class.buckets[0].sig_terms.buckets[0].key: + this.IsMatch(_response.aggregations.@class.buckets[0].sig_terms.buckets[0].key, @"bad"); + + //match _response.aggregations.@class.buckets[1].sig_terms.buckets[0].key: + this.IsMatch(_response.aggregations.@class.buckets[1].sig_terms.buckets[0].key, @"good"); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/snapshot.get_repository/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/snapshot.get_repository/10_basic.yaml.cs index 0439cb1e78c..f576a2f5e7d 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/snapshot.get_repository/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/snapshot.get_repository/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/10_basic.yaml.cs index 10a909d83f0..d04642a557c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/20_context.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/20_context.yaml.cs index c3e2c4ea24b..8a3a7bcd4f2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/20_context.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/suggest/20_context.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -261,8 +264,8 @@ public void GeoSuggestShouldWork5Test() input= "Hotel Marriot in Amsterdam", context= new { location= new { - lat= "52.22", - lon= "4.53" + lat= 52.22, + lon= 4.53 } } } @@ -275,8 +278,8 @@ public void GeoSuggestShouldWork5Test() input= "Hotel Marriot in Berlin", context= new { location= new { - lat= "53.31", - lon= "13.24" + lat= 53.31, + lon= 13.24 } } } @@ -297,8 +300,8 @@ public void GeoSuggestShouldWork5Test() field= "suggest_geo", context= new { location= new { - lat= "52.22", - lon= "4.53" + lat= 52.22, + lon= 4.53 } } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/template/20_search.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/template/20_search.yaml.cs new file mode 100644 index 00000000000..3623bc413b3 --- /dev/null +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/template/20_search.yaml.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; + + +namespace Elasticsearch.Net.Integration.Yaml.Template2 +{ + public partial class Template2YamlTests + { + + + [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] + public class IndexedTemplateQueryTests1Tests : YamlTestsBase + { + [Test] + public void IndexedTemplateQueryTests1Test() + { + + //do index + _body = new { + text= "value1_foo" + }; + this.Do(()=> _client.Index("test", "testtype", "1", _body)); + + //do index + _body = new { + text= "value2_foo value3_foo" + }; + this.Do(()=> _client.Index("test", "testtype", "2", _body)); + + //do indices.refresh + this.Do(()=> _client.IndicesRefreshForAll()); + + //do put_template + _body = new { + template= new { + query= new { + match= new { + text= "new {new {my_value}}" + } + }, + size= "new {new {my_size}}" + } + }; + + + //match _response._id: + this.IsMatch(_response._id, 1); + + //do indices.refresh + this.Do(()=> _client.IndicesRefreshForAll()); + + //do search_template + _body = new { + template= new { + id= "1" + }, + @params= new { + my_value= "value1_foo", + my_size= "1" + } + }; + this.Do(()=> _client.SearchTemplate(_body)); + + //match _response.hits.total: + this.IsMatch(_response.hits.total, 1); + + //do search_template + _body = new { + id= "1", + @params= new { + my_value= "value1_foo", + my_size= "1" + } + }; + this.Do(()=> _client.SearchTemplate(_body)); + + //match _response.hits.total: + this.IsMatch(_response.hits.total, 1); + + } + } + } +} + diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/termvector/10_basic.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/termvector/10_basic.yaml.cs index 868fc7a30e4..b172898eb78 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/termvector/10_basic.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/termvector/10_basic.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/10_doc.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/10_doc.yaml.cs index d9c80b3d32f..5e02916594c 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/10_doc.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/10_doc.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/15_script.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/15_script.yaml.cs index 67bb3075b86..ca24507770f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/15_script.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/15_script.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/20_doc_upsert.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/20_doc_upsert.yaml.cs index 48d1aa1b3f1..7a540e5745b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/20_doc_upsert.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/20_doc_upsert.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/22_doc_as_upsert.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/22_doc_as_upsert.yaml.cs index 3b07952ec44..47ef215a9a2 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/22_doc_as_upsert.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/22_doc_as_upsert.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/25_script_upsert.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/25_script_upsert.yaml.cs index e2e7d2f39d3..d80f08240b3 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/25_script_upsert.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/25_script_upsert.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/30_internal_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/30_internal_version.yaml.cs index 6541d048c9a..f8542c2b892 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/30_internal_version.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/30_internal_version.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_external_version.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_external_version.yaml.cs deleted file mode 100644 index 493b9fd422a..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_external_version.yaml.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.Update7 -{ - public partial class Update7YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class ExternalVersion1Tests : YamlTestsBase - { - [Test] - public void ExternalVersion1Test() - { - - //do update - _body = new { - doc= new { - foo= "baz" - }, - upsert= new { - foo= "bar" - } - }; - this.Do(()=> _client.Update("test_1", "test", "1", _body, nv=>nv - .AddQueryString("version", 2) - .AddQueryString("version_type", @"external") - )); - - //match _response._version: - this.IsMatch(_response._version, 2); - - //do update - _body = new { - doc= new { - foo= "baz" - }, - upsert= new { - foo= "bar" - } - }; - this.Do(()=> _client.Update("test_1", "test", "1", _body, nv=>nv - .AddQueryString("version", 2) - .AddQueryString("version_type", @"external") - ), shouldCatch: @"conflict"); - - //do update - _body = new { - doc= new { - foo= "baz" - }, - upsert= new { - foo= "bar" - } - }; - this.Do(()=> _client.Update("test_1", "test", "1", _body, nv=>nv - .AddQueryString("version", 3) - .AddQueryString("version_type", @"external") - )); - - //match _response._version: - this.IsMatch(_response._version, 3); - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_other_versions.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_other_versions.yaml.cs index c1bfc26eeac..ff6dfd458eb 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_other_versions.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/35_other_versions.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/40_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/40_routing.yaml.cs index b5fde166727..f48a4c83b47 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/40_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/40_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/50_parent.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/50_parent.yaml.cs index 9d56ff1b589..075cbd52a73 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/50_parent.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/50_parent.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/55_parent_with_routing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/55_parent_with_routing.yaml.cs index 601e1dea0f4..e9a82dba92f 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/55_parent_with_routing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/55_parent_with_routing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/60_refresh.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/60_refresh.yaml.cs deleted file mode 100644 index 8d77dcdfdb8..00000000000 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/60_refresh.yaml.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - - -namespace Elasticsearch.Net.Integration.Yaml.Update11 -{ - public partial class Update11YamlTests - { - - - [NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")] - public class Refresh1Tests : YamlTestsBase - { - [Test] - public void Refresh1Test() - { - - //do indices.create - _body = new { - settings= new Dictionary { - { "index.refresh_interval", "-1" } - } - }; - this.Do(()=> _client.IndicesCreate("test_1", _body)); - - //do cluster.health - this.Do(()=> _client.ClusterHealth(nv=>nv - .AddQueryString("wait_for_status", @"yellow") - )); - - //do update - _body = new { - doc= new { - foo= "baz" - }, - upsert= new { - foo= "bar" - } - }; - this.Do(()=> _client.Update("test_1", "test", "1", _body)); - - //do search - _body = new { - query= new { - term= new { - _id= "1" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 0); - - //do update - _body = new { - doc= new { - foo= "baz" - }, - upsert= new { - foo= "bar" - } - }; - this.Do(()=> _client.Update("test_1", "test", "2", _body, nv=>nv - .AddQueryString("refresh", 1) - )); - - //do search - _body = new { - query= new { - term= new { - _id= "2" - } - } - }; - this.Do(()=> _client.Search("test_1", "test", _body)); - - //match _response.hits.total: - this.IsMatch(_response.hits.total, 1); - - } - } - } -} - diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/70_timestamp.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/70_timestamp.yaml.cs index 5c037b009d4..f06479eee15 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/70_timestamp.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/70_timestamp.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; @@ -64,7 +67,7 @@ public void Timestamp1Test() } }; this.Do(()=> _client.Update("test_1", "test", "1", _body, nv=>nv - .AddQueryString("timestamp", @"1372011280000") + .AddQueryString("timestamp", 1372011280000) )); //do get @@ -73,7 +76,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); //do update _body = new { @@ -94,7 +97,7 @@ public void Timestamp1Test() )); //match _response.fields._timestamp: - this.IsMatch(_response.fields._timestamp, @"1372011280000"); + this.IsMatch(_response.fields._timestamp, 1372011280000); } } diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/75_ttl.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/75_ttl.yaml.cs index 2d85f1bb05e..d220a3c0265 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/75_ttl.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/75_ttl.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/80_fields.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/80_fields.yaml.cs index 3620669ab3d..c906c84026b 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/80_fields.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/80_fields.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/85_fields_meta.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/85_fields_meta.yaml.cs index 3096122eb78..d4f969fda25 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/85_fields_meta.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/85_fields_meta.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework; diff --git a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/90_missing.yaml.cs b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/90_missing.yaml.cs index 4fd3daf1251..287799f1bb9 100644 --- a/src/Tests/Elasticsearch.Net.Integration.Yaml/update/90_missing.yaml.cs +++ b/src/Tests/Elasticsearch.Net.Integration.Yaml/update/90_missing.yaml.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using System.Text; +using System.Threading.Tasks; using NUnit.Framework;