public async void TestGetNOMRecordsConvertToTWithParameters() { var expectedDic = new Dictionary <string, Country>() { { "186", new Country() { CountryID = "186", CountryName = "Russia" } }, { "216", new Country() { CountryID = "216", CountryName = "United States" } } }; var resultDic = new Dictionary <string, Country>(); var context = new NeoContext(Driver); var result = await context.GetNeoDataRecordsAsync("match(n:Country) WHERE n.countryID IN [$p1,$p2] return n", new Dictionary <string, object>() { { "p1", "186" }, { "p2", "216" } }); Assert.NotNull(result); foreach (var neoRecord in result) { Country c = neoRecord.GetAndConvert <Country>("n"); resultDic.Add(c.CountryID, c); } foreach (var country in expectedDic.Values) { Assert.True(IsEqual(country, resultDic[country.CountryID])); } }
public async void TestGetNOMRecordsDynamic() { var expectedDic = new Dictionary <string, Country>() { { "186", new Country() { CountryID = "186", CountryName = "Russia" } }, { "216", new Country() { CountryID = "216", CountryName = "United States" } } }; var resultDic = new Dictionary <string, Country>(); var context = new NeoContext(Driver); var result = await context.GetNeoDataRecordsAsync("match(n:Country) WHERE n.countryID IN ['186','216'] return n"); Assert.NotNull(result); foreach (var neoRecord in result) { Country c = new Country() { CountryID = neoRecord["n"].countryID, CountryName = neoRecord["n"].countryName }; resultDic.Add(c.CountryID, c); } foreach (var country in expectedDic.Values) { Assert.True(IsEqual(country, resultDic[country.CountryID])); } }