|
9 | 9 | using Elastic.Elasticsearch.Xunit.XunitPlumbing; |
10 | 10 | using Nest; |
11 | 11 | using Tests.Core.Client; |
| 12 | +using Tests.Core.Extensions; |
12 | 13 | using Tests.Core.Xunit; |
13 | 14 | using Tests.Domain; |
14 | 15 |
|
@@ -56,22 +57,33 @@ public static IPromise<IList<IProcessor>> Fluent(ProcessorsDescriptor d) |
56 | 57 | foreach (var a in All) a.Fluent(d); |
57 | 58 | return d; |
58 | 59 | } |
59 | | - |
| 60 | + |
60 | 61 | public class Append : ProcessorAssertion |
61 | 62 | { |
62 | | - public override Func<ProcessorsDescriptor, IPromise<IList<IProcessor>>> Fluent => d => d |
63 | | - .Append<Project>(a => a |
64 | | - .Field(p => p.State) |
65 | | - .Value(StateOfBeing.Stable, StateOfBeing.VeryActive) |
66 | | - ); |
| 63 | + public override Func<ProcessorsDescriptor, IPromise<IList<IProcessor>>> Fluent => |
| 64 | + d => d.Append<Project>(a => a.Field(p => p.State).Value(StateOfBeing.Stable, StateOfBeing.VeryActive)); |
67 | 65 |
|
68 | | - public override IProcessor Initializer => new AppendProcessor |
| 66 | + public override IProcessor Initializer => new AppendProcessor { Field = "state", Value = new object[] { StateOfBeing.Stable, StateOfBeing.VeryActive }}; |
| 67 | + |
| 68 | + public override object Json => new |
69 | 69 | { |
70 | | - Field = "state", |
71 | | - Value = new object[] { StateOfBeing.Stable, StateOfBeing.VeryActive } |
| 70 | + field = "state", |
| 71 | + value = new[] { "Stable", "VeryActive" } |
72 | 72 | }; |
73 | 73 |
|
74 | | - public override object Json => new { field = "state", value = new[] { "Stable", "VeryActive" } }; |
| 74 | + public override string Key => "append"; |
| 75 | + } |
| 76 | + |
| 77 | + [SkipVersion("<7.11.0", "Allow duplicates added in 7.11")] |
| 78 | + public class AppendWithAllowDuplicates : ProcessorAssertion |
| 79 | + { |
| 80 | + public override Func<ProcessorsDescriptor, IPromise<IList<IProcessor>>> Fluent => |
| 81 | + d => d.Append<Project>(a => a.Field(p => p.State).Value(StateOfBeing.Stable, StateOfBeing.VeryActive).AllowDuplicates(false)); |
| 82 | + |
| 83 | + public override IProcessor Initializer => new AppendProcessor { Field = "state", Value = new object[] { StateOfBeing.Stable, StateOfBeing.VeryActive }, AllowDuplicates = false }; |
| 84 | + |
| 85 | + public override object Json => new { field = "state", value = new[] { "Stable", "VeryActive" }, allow_duplicates = false }; |
| 86 | + |
75 | 87 | public override string Key => "append"; |
76 | 88 | } |
77 | 89 |
|
|
0 commit comments