From 32a1c5ca1d000c148d34bca356fc950bc059dcbf Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 3 Oct 2018 21:19:39 +0000 Subject: [PATCH] --- test/raven-integration/Search/SearchOps.cs | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/raven-integration/Search/SearchOps.cs b/test/raven-integration/Search/SearchOps.cs index f281f006..56905680 100644 --- a/test/raven-integration/Search/SearchOps.cs +++ b/test/raven-integration/Search/SearchOps.cs @@ -95,10 +95,10 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(3); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(3); //Turn the list into an array of id's - var v = ((JArray)a.ObjectResponse["result"]); + var v = ((JArray)a.ObjectResponse["result"]["searchResults"]); List MatchingIdList = new List(); foreach (JObject j in v) { @@ -114,10 +114,10 @@ namespace raven_integration //Assert the order (roughly, this is kind of a waste of time, either the code is sorting or not, it's not going to change) //first item must be a widget - a.ObjectResponse["result"][0]["type"].Value().Should().Be(2); + a.ObjectResponse["result"]["searchResults"][0]["type"].Value().Should().Be(2); //final item must be a user - a.ObjectResponse["result"][MatchingIdList.Count - 1]["type"].Value().Should().Be(3); + a.ObjectResponse["result"]["searchResults"][MatchingIdList.Count - 1]["type"].Value().Should().Be(3); //FULL BODY SEARCH RIGHTS @@ -129,7 +129,7 @@ namespace raven_integration //This search should return zero items a = await Util.PostAsync("Search", await Util.GetTokenAsync("SubContractorLimited"), SearchParameters.ToString()); Util.ValidateDataReturnResponseOk(a); - ((JArray)a.ObjectResponse["result"]).Count.Should().Be(0, "User with no rights should not see any results in body search"); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().Be(0, "User with no rights should not see any results in body search"); //NAME ONLY SEARCH SHOULD WORK WITH NO RIGHTS TO READ FULL RECORD @@ -140,10 +140,10 @@ namespace raven_integration SearchParameters.typeOnly = 0;//no type a = await Util.PostAsync("Search", await Util.GetTokenAsync("SubContractorLimited"), SearchParameters.ToString()); Util.ValidateDataReturnResponseOk(a); - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(2); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2); //Check that list does *not* include the notes only records MatchingIdList = new List(); - v = ((JArray)a.ObjectResponse["result"]); + v = ((JArray)a.ObjectResponse["result"]["searchResults"]); foreach (JObject j in v) { MatchingIdList.Add(j["id"].Value()); @@ -205,10 +205,10 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(2); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2); //Turn the list into an array of id's - var v = ((JArray)a.ObjectResponse["result"]); + var v = ((JArray)a.ObjectResponse["result"]["searchResults"]); List MatchingIdList = new List(); foreach (JObject j in v) { @@ -266,10 +266,10 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(2); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2); //Turn the list into an array of id's - var v = ((JArray)a.ObjectResponse["result"]); + var v = ((JArray)a.ObjectResponse["result"]["searchResults"]); List MatchingIdList = new List(); foreach (JObject j in v) { @@ -329,10 +329,10 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(2); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2); //Turn the list into an array of id's - var v = ((JArray)a.ObjectResponse["result"]); + var v = ((JArray)a.ObjectResponse["result"]["searchResults"]); List MatchingIdList = new List(); foreach (JObject j in v) { @@ -431,10 +431,10 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(1); + ((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(1); //Turn the list into an array of id's - var v = ((JArray)a.ObjectResponse["result"]); + var v = ((JArray)a.ObjectResponse["result"]["searchResults"]); List MatchingIdList = new List(); foreach (JObject j in v) { @@ -475,7 +475,7 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - var ResultCount = ((JArray)a.ObjectResponse["result"]).Count; + var ResultCount = ((JArray)a.ObjectResponse["result"]["searchResults"]).Count; //assert it's not unbounded ResultCount.Should().BeLessOrEqualTo(1000); @@ -510,7 +510,7 @@ namespace raven_integration Util.ValidateDataReturnResponseOk(a); //Now validate the return list - var ResultCount = ((JArray)a.ObjectResponse["result"]).Count; + var ResultCount = ((JArray)a.ObjectResponse["result"]["searchResults"]).Count; //Set this time based on testing. 52385 Slowest run plus 10%