File tree 1 file changed +10
-1
lines changed
src/Tests/Nest.Tests.Unit/Reproduce
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 3
3
using NUnit . Framework ;
4
4
using System ;
5
5
using System . Collections . Generic ;
6
+ using System . IO ;
6
7
using System . Linq ;
7
8
using System . Reflection ;
8
9
using System . Text ;
9
10
using System . Threading . Tasks ;
11
+ using Elasticsearch . Net . Connection ;
10
12
11
13
namespace Nest . Tests . Unit . Reproduce
12
14
{
@@ -16,17 +18,24 @@ public class Reproduce1464Tests : BaseJsonTests
16
18
[ Test ]
17
19
public void Issue1464 ( )
18
20
{
21
+ var rawClient = new ElasticsearchClient ( connection : new InMemoryConnection ( new ConnectionSettings ( ) ) ) ;
22
+
19
23
var bulkEntries = new List < object > ( ) ;
20
24
bulkEntries . Add ( new { index = new { _index = "ourIndex" , _type = "ourType" , _id = "ourId" } } ) ;
21
25
22
- var doc = JsonConvert . DeserializeObject < dynamic > ( "{ \" id\" : \" 3\" }" ) ;
26
+ var doc = rawClient . Serializer . Deserialize < dynamic > ( new MemoryStream ( "{ \" id\" : \" 3\" }" . Utf8Bytes ( ) ) ) ;
23
27
doc . someprop = "some value" ;
24
28
bulkEntries . Add ( doc ) ;
25
29
26
30
var response = this . _client . Raw . Bulk ( bulkEntries ) ;
27
31
var actual = response . Request . Utf8String ( ) ;
32
+ this . BulkJsonEquals ( actual , MethodBase . GetCurrentMethod ( ) ) ;
28
33
34
+ response = rawClient . Bulk ( bulkEntries ) ;
35
+ actual = response . Request . Utf8String ( ) ;
29
36
this . BulkJsonEquals ( actual , MethodBase . GetCurrentMethod ( ) ) ;
37
+
38
+
30
39
}
31
40
}
32
41
}
You can’t perform that action at this time.
0 commit comments