public void TestDefaultContextParentNestedSkillWithStringAndLongCollection() { using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver)) { context.TraceProvider = new ConsoleTraceProvider(); var skillWithIntArray = new SkillWithStringLongAndDoubleCollection { MyStringArray = new List <String> { "one", "two", "three" }, BlahBlah = "test3 with int array", Id = 2, MyDoubleArray = new List <double> { 2.4, 5.7, 67.345 }, MyLongArray = new List <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 <SkillWithStringLongAndDoubleCollection>(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 TestDefaultContextParentNestedSkillWithStringAndLongCollection() { using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver)) { context.TraceProvider = new ConsoleTraceProvider(); var skillWithIntArray = new SkillWithStringLongAndDoubleCollection { MyStringArray = new List<String> { "one", "two","three" }, BlahBlah = "test3 with int array", Id = 2, MyDoubleArray = new List<double> { 2.4, 5.7, 67.345 }, MyLongArray = new List<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<SkillWithStringLongAndDoubleCollection>(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]); } }