public void TestDefaultContextParentNestedSkillWithStringAndLongArray() { using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver)) { context.TraceProvider = new ConsoleTraceProvider(); var skillWithIntArray = new SkillWithStringLongAndDoubleArray { MyStringArray = new[] { "one", "two", "three" }, BlahBlah = "test3 with int array", Id = 2, MyDoubleArray = new[] { 2.4, 5.7, 67.345 }, MyLongArray = new long[] { 34444445, 65432, 7889999 } }; context.AddUpdateDocument(skillWithIntArray, skillWithIntArray.Id); // Save to Elasticsearch var ret = context.SaveChanges(); Assert.Equal(ret.Status, HttpStatusCode.OK); var returned = context.GetDocument <SkillWithStringLongAndDoubleArray>(2); Assert.Equal(skillWithIntArray.MyStringArray[2], returned.MyStringArray[2]); Assert.Equal(skillWithIntArray.MyDoubleArray[1], returned.MyDoubleArray[1]); Assert.Equal(skillWithIntArray.MyLongArray[1], returned.MyLongArray[1]); } }
public void TestDefaultContextParentNestedSkillWithStringAndLongArray() { using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver)) { context.TraceProvider = new ConsoleTraceProvider(); var skillWithIntArray = new SkillWithStringLongAndDoubleArray { MyStringArray = new[] { "one", "two","three" }, BlahBlah = "test3 with int array", Id = 2, MyDoubleArray = new[] { 2.4, 5.7, 67.345 }, MyLongArray = new long[] { 34444445, 65432, 7889999 } }; context.AddUpdateDocument(skillWithIntArray, skillWithIntArray.Id); // Save to Elasticsearch var ret = context.SaveChanges(); Assert.AreEqual(ret.Status, HttpStatusCode.OK); var returned = context.GetDocument<SkillWithStringLongAndDoubleArray>(2); Assert.AreEqual(skillWithIntArray.MyStringArray[2], returned.MyStringArray[2]); Assert.AreEqual(skillWithIntArray.MyDoubleArray[1], returned.MyDoubleArray[1]); Assert.AreEqual(skillWithIntArray.MyLongArray[1], returned.MyLongArray[1]); } }