From 403be19cdbd35c14f1bba97172aefd61847299e1 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 21 Sep 2018 18:51:11 +0000 Subject: [PATCH] --- test/raven-integration/Search/SearchOps.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/raven-integration/Search/SearchOps.cs b/test/raven-integration/Search/SearchOps.cs index 421f8d95..30fe9491 100644 --- a/test/raven-integration/Search/SearchOps.cs +++ b/test/raven-integration/Search/SearchOps.cs @@ -1,7 +1,9 @@ using System; using Xunit; using Newtonsoft.Json.Linq; +using System.Linq; using FluentAssertions; +using System.Collections.Generic; namespace raven_integration { @@ -66,8 +68,22 @@ namespace raven_integration a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); Util.ValidateDataReturnResponseOk(a); + //Now validate the return list + ((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterOrEqualTo(2); - } + //Turn the list into an array of id's + var v = ((JArray)a.ObjectResponse["result"]); + List MatchingIdList = new List(); + foreach (JObject j in v) + { + MatchingIdList.Add(j["id"].Value()); + } + + MatchingIdList.Should().Contain(MatchFirstWidgetId, "ShouldContainFirstWidget"); + MatchingIdList.Should().Contain(MatchSecondWidgetId, "ShouldContainSecondWidget"); + MatchingIdList.Should().NotContain(NoMatchThirdWidgetId, "ShouldNotContainThirdWidget"); + + }//eot