Skip to content

Commit 9565667

Browse files
committed
Adding test in attempt to reproduce #1464
1 parent 0db92a2 commit 9565667

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/Tests/Nest.Tests.Unit/Nest.Tests.Unit.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,13 @@
406406
<Compile Include="QueryParsers\Visitor\DslPrettyPrintVisitor.cs" />
407407
<Compile Include="QueryParsers\Visitor\VisitorDemoUseCase.cs" />
408408
<Compile Include="QueryParsers\Visitor\VisitorTests.cs" />
409+
<None Include="Reproduce\Issue1464.json">
410+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
411+
</None>
409412
<Compile Include="Reproduce\Reproduce1396Tests.cs" />
410413
<Compile Include="Reproduce\Reproduce1199Tests.cs" />
411414
<Compile Include="Reproduce\Reproduce1146Tests.cs" />
415+
<Compile Include="Reproduce\Reproduce1464Tests.cs" />
412416
<Compile Include="Reproduce\Reproduce629Tests.cs" />
413417
<Compile Include="Reproduce\Reproduce1187Tests.cs" />
414418
<Compile Include="Reproduce\Reproduce901Tests.cs" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"index":{"_index":"ourIndex","_type":"ourType","_id":"ourId"}}
2+
{"id":"3","someprop":"some value"}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Elasticsearch.Net;
2+
using Newtonsoft.Json;
3+
using NUnit.Framework;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Reflection;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
11+
namespace Nest.Tests.Unit.Reproduce
12+
{
13+
[TestFixture]
14+
public class Reproduce1464Tests : BaseJsonTests
15+
{
16+
[Test]
17+
public void Issue1464()
18+
{
19+
var bulkEntries = new List<object>();
20+
bulkEntries.Add(new { index = new { _index = "ourIndex", _type = "ourType", _id = "ourId" } });
21+
22+
var doc = JsonConvert.DeserializeObject<dynamic>("{ \"id\": \"3\"}");
23+
doc.someprop = "some value";
24+
bulkEntries.Add(doc);
25+
26+
var response = this._client.Raw.Bulk(bulkEntries);
27+
var actual = response.Request.Utf8String();
28+
29+
this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)