<commit_before>﻿using Elasticsearch.Net;
using Newtonsoft.Json;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Nest.Tests.Unit.Reproduce
{
	[TestFixture]
	public class Reproduce1464Tests : BaseJsonTests
	{
		[Test]
		public void Issue1464()
		{
			var bulkEntries = new List<object>();
			bulkEntries.Add(new { index = new { _index = "ourIndex", _type = "ourType", _id = "ourId" } });

			var doc = JsonConvert.DeserializeObject<dynamic>("{ \"id\": \"3\"}");
			doc.someprop = "some value";
			bulkEntries.Add(doc);

			var response = this._client.Raw.Bulk(bulkEntries);
			var actual = response.Request.Utf8String();

			this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());
		}
	}
}
<commit_msg>updated test #1464 to show correct usage<commit_after>﻿using Elasticsearch.Net;
using Newtonsoft.Json;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Elasticsearch.Net.Connection;

namespace Nest.Tests.Unit.Reproduce
{
	[TestFixture]
	public class Reproduce1464Tests : BaseJsonTests
	{
		[Test]
		public void Issue1464()
		{
			var rawClient = new ElasticsearchClient(connection: new InMemoryConnection(new ConnectionSettings()));

			var bulkEntries = new List<object>();
			bulkEntries.Add(new { index = new { _index = "ourIndex", _type = "ourType", _id = "ourId" } });

			var doc = rawClient.Serializer.Deserialize<dynamic>(new MemoryStream("{ \"id\": \"3\"}".Utf8Bytes()));
			doc.someprop = "some value";
			bulkEntries.Add(doc);

			var response = this._client.Raw.Bulk(bulkEntries);
			var actual = response.Request.Utf8String();
			this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());

			response = rawClient.Bulk(bulkEntries);
			actual = response.Request.Utf8String();
			this.BulkJsonEquals(actual, MethodBase.GetCurrentMethod());


		}
	}
}

{'fraction_non_alphanumeric': 0.13280865715691098, 'fraction_numerical': 0.01278898180029513, 'mean_word_length': 4.861671469740634, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6437112', 'n_tokens_mistral': 714, 'n_tokens_neox': 654, 'n_words': 142}