Changed api response "result" to "data"
This commit is contained in:
@@ -26,7 +26,7 @@ namespace raven_integration
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE FIRST TEST USER WITH PHRASE IN NAME
|
||||
D = new JObject();
|
||||
@@ -42,7 +42,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE A SECOND TEST USER WITH PHRASE IN NOTES
|
||||
D = new JObject();
|
||||
@@ -58,7 +58,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE A SECOND WIDGET
|
||||
D = new JObject();
|
||||
@@ -70,7 +70,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE A THIRD WIDGET
|
||||
D = new JObject();
|
||||
@@ -82,7 +82,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchNothingWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchNothingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//Now see if can find those objects with a phrase search
|
||||
@@ -96,10 +96,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(3);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(3);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
@@ -115,10 +115,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"]["searchResults"][0]["type"].Value<int>().Should().Be(2);
|
||||
a.ObjectResponse["data"]["searchResults"][0]["type"].Value<int>().Should().Be(2);
|
||||
|
||||
//final item must be a user
|
||||
a.ObjectResponse["result"]["searchResults"][MatchingIdList.Count - 1]["type"].Value<int>().Should().Be(3);
|
||||
a.ObjectResponse["data"]["searchResults"][MatchingIdList.Count - 1]["type"].Value<int>().Should().Be(3);
|
||||
|
||||
|
||||
//FULL BODY SEARCH RIGHTS
|
||||
@@ -130,7 +130,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"]["searchResults"]).Count.Should().Be(0, "User with no rights should not see any results in body search");
|
||||
((JArray)a.ObjectResponse["data"]["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
|
||||
@@ -142,10 +142,10 @@ namespace raven_integration
|
||||
SearchParameters.maxResults=0;
|
||||
a = await Util.PostAsync("Search", await Util.GetTokenAsync("SubContractorLimited"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
//Check that list does *not* include the notes only records
|
||||
MatchingIdList = new List<long>();
|
||||
v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
MatchingIdList.Add(j["id"].Value<long>());
|
||||
@@ -175,7 +175,7 @@ namespace raven_integration
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE FIRST TEST USER WITH PHRASE IN NAME
|
||||
D = new JObject();
|
||||
@@ -191,7 +191,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//Now see if can find those objects with a phrase search
|
||||
@@ -205,10 +205,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
@@ -237,7 +237,7 @@ namespace raven_integration
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE FIRST TEST USER WITH PHRASE IN NAME
|
||||
D = new JObject();
|
||||
@@ -253,7 +253,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//Now see if can find those objects with a phrase search
|
||||
@@ -267,10 +267,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ namespace raven_integration
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//CREATE FIRST TEST USER WITH PHRASE IN NAME
|
||||
D = new JObject();
|
||||
@@ -317,7 +317,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//Now see if can find those objects with a phrase search
|
||||
@@ -331,10 +331,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(2);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
@@ -358,7 +358,7 @@ namespace raven_integration
|
||||
D.name = Util.Uniquify("TAGSEARCH");
|
||||
ApiResponse a = await Util.PostAsync("Tag", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long TagId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long TagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//CREATE A WIDGET
|
||||
@@ -371,7 +371,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//TAG the widget with the fresh tag
|
||||
D = new JObject();
|
||||
@@ -392,7 +392,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long NoPhraseMatchWidgetInTagId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long NoPhraseMatchWidgetInTagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//TAG the tag only no phrase with the fresh tag
|
||||
D = new JObject();
|
||||
@@ -418,7 +418,7 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//Now see if can find those objects with a phrase search
|
||||
@@ -433,10 +433,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(1);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(1);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
@@ -477,14 +477,14 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
var ResultCount = ((JArray)a.ObjectResponse["result"]["searchResults"]).Count;
|
||||
var ResultCount = ((JArray)a.ObjectResponse["data"]["searchResults"]).Count;
|
||||
//assert it's not unbounded
|
||||
ResultCount.Should().BeLessOrEqualTo(1000);
|
||||
|
||||
if (ResultCount > 999)
|
||||
{
|
||||
//assert the TotalResultsFound is greater than the results returned
|
||||
var TotalResultsFound = a.ObjectResponse["result"]["totalResultsFound"].Value<long>();
|
||||
var TotalResultsFound = a.ObjectResponse["data"]["totalResultsFound"].Value<long>();
|
||||
//assert it's not unbounded
|
||||
TotalResultsFound.Should().BeGreaterThan(ResultCount);
|
||||
}
|
||||
@@ -519,7 +519,7 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
var ResultCount = ((JArray)a.ObjectResponse["result"]["searchResults"]).Count;
|
||||
var ResultCount = ((JArray)a.ObjectResponse["data"]["searchResults"]).Count;
|
||||
|
||||
|
||||
//Set this time based on testing. 52385 Slowest run plus 10%
|
||||
@@ -543,8 +543,8 @@ namespace raven_integration
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInSerialId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
var MatchWidgetSerial = a.ObjectResponse["result"]["serial"].Value<uint>();
|
||||
long MatchWidgetInSerialId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
var MatchWidgetSerial = a.ObjectResponse["data"]["serial"].Value<uint>();
|
||||
|
||||
//TODO: get this from the return object
|
||||
string SerialSearch=MatchWidgetInSerialId.ToString();;
|
||||
@@ -560,10 +560,10 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
((JArray)a.ObjectResponse["result"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(1);
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().BeGreaterOrEqualTo(1);
|
||||
|
||||
//Turn the list into an array of id's
|
||||
var v = ((JArray)a.ObjectResponse["result"]["searchResults"]);
|
||||
var v = ((JArray)a.ObjectResponse["data"]["searchResults"]);
|
||||
List<long> MatchingIdList = new List<long>();
|
||||
foreach (JObject j in v)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user