Skip to content

Commit 5a1e12d

Browse files
committed
updated test #1464 to show correct usage
1 parent d52edee commit 5a1e12d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/Tests/Nest.Tests.Unit/Reproduce/Reproduce1464Tests.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
using NUnit.Framework;
44
using System;
55
using System.Collections.Generic;
6+
using System.IO;
67
using System.Linq;
78
using System.Reflection;
89
using System.Text;
910
using System.Threading.Tasks;
11+
using Elasticsearch.Net.Connection;
1012

1113
namespace Nest.Tests.Unit.Reproduce
1214
{
@@ -16,17 +18,24 @@ public class Reproduce1464Tests : BaseJsonTests
1618
[Test]
1719
public void Issue1464()
1820
{
21+
var rawClient = new ElasticsearchClient(connection: new InMemoryConnection(new ConnectionSettings()));
22+
1923
var bulkEntries = new List<object>();
2024
bulkEntries.Add(new { index = new { _index = "ourIndex", _type = "ourType", _id = "ourId" } });
2125

22-
var doc = JsonConvert.DeserializeObject<dynamic>("{ \"id\": \"3\"}");
26+
var doc = rawClient.Serializer.Deserialize<dynamic>(new MemoryStream("{ \"id\": \"3\"}".Utf8Bytes()));
2327
doc.someprop = "some value";
2428
bulkEntries.Add(doc);
2529

2630
var response = this._client.Raw.Bulk(bulkEntries);
2731
var actual = response.Request.Utf8String();
32+
this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());
2833

34+
response = rawClient.Bulk(bulkEntries);
35+
actual = response.Request.Utf8String();
2936
this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());
37+
38+
3039
}
3140
}
3241
}

0 commit comments

Comments
 (0)