Changed api response "result" to "data"

This commit is contained in:
2018-11-07 16:05:21 +00:00
parent e2330974f6
commit 6c7376f2e8
27 changed files with 227 additions and 270 deletions

View File

@@ -27,7 +27,7 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200);
//there should be at least 4 of them as there are 4 stock locales
((JArray)a.ObjectResponse["result"]).Count.Should().BeGreaterThan(3);
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(3);
}
@@ -39,7 +39,7 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200);
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
((JArray)a.ObjectResponse["result"]["localeItems"]).Count.Should().BeGreaterThan(0);
((JArray)a.ObjectResponse["data"]["localeItems"]).Count.Should().BeGreaterThan(0);
}
@@ -65,7 +65,7 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200);
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
((JArray)a.ObjectResponse["result"]).Count.Should().Be(4);
((JArray)a.ObjectResponse["data"]).Count.Should().Be(4);
}
@@ -88,13 +88,13 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 201);
//verify the object returned is as expected
a.ObjectResponse["result"]["name"].Value<string>().Should().Be(d.name.ToString());
a.ObjectResponse["result"]["stock"].Value<bool>().Should().Be(false);
a.ObjectResponse["result"]["id"].Value<long>().Should().BeGreaterThan(4);
a.ObjectResponse["result"]["concurrencyToken"].Value<uint>().Should().BeGreaterThan(0);
((JArray)a.ObjectResponse["result"]["localeItems"]).Count.Should().BeGreaterThan(0);
a.ObjectResponse["data"]["name"].Value<string>().Should().Be(d.name.ToString());
a.ObjectResponse["data"]["stock"].Value<bool>().Should().Be(false);
a.ObjectResponse["data"]["id"].Value<long>().Should().BeGreaterThan(4);
a.ObjectResponse["data"]["concurrencyToken"].Value<uint>().Should().BeGreaterThan(0);
((JArray)a.ObjectResponse["data"]["localeItems"]).Count.Should().BeGreaterThan(0);
long NewId = a.ObjectResponse["result"]["id"].Value<long>();
long NewId = a.ObjectResponse["data"]["id"].Value<long>();
//UPDATE
//Update locale name
@@ -111,19 +111,19 @@ namespace raven_integration
dynamic d2 = new JObject();
d2.id = NewId;
d2.newText = Util.Uniquify("INTEGRATION-TEST-LOCALE NAME UPDATE");
d2.concurrencyToken = a.ObjectResponse["result"]["concurrencyToken"].Value<uint>();
d2.concurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
ApiResponse PUTTestResponse = await Util.PutAsync("Locale/UpdateLocaleName", await Util.GetTokenAsync("BizAdminFull"), d2.ToString());
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
ApiResponse checkPUTWorked = await Util.GetAsync("Locale/" + NewId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateNoErrorInResponse(checkPUTWorked);
checkPUTWorked.ObjectResponse["result"]["name"].Value<string>().Should().Be(d2.newText.ToString());
//uint concurrencyToken = PUTTestResponse.ObjectResponse["result"]["concurrencyToken"].Value<uint>();
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(d2.newText.ToString());
//uint concurrencyToken = PUTTestResponse.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
//Update locale key
var FirstLocaleKey = ((JArray)a.ObjectResponse["result"]["localeItems"])[0];
var FirstLocaleKey = ((JArray)a.ObjectResponse["data"]["localeItems"])[0];
long UpdatedLocaleKeyId = FirstLocaleKey["id"].Value<long>();
d2.id = UpdatedLocaleKeyId;
d2.newText = Util.Uniquify("INTEGRATION-TEST-LOCALEITEM DISPLAY UPDATE");
@@ -143,8 +143,8 @@ namespace raven_integration
checkPUTWorked = await Util.PostAsync("Locale/subset", await Util.GetTokenAsync("ClientLimited"), d3.ToString());
Util.ValidateDataReturnResponseOk(checkPUTWorked);
Util.ValidateHTTPStatusCode(checkPUTWorked, 200);
((JArray)checkPUTWorked.ObjectResponse["result"]).Count.Should().Be(1);
var FirstLocaleKeyUpdated = ((JArray)checkPUTWorked.ObjectResponse["result"])[0];
((JArray)checkPUTWorked.ObjectResponse["data"]).Count.Should().Be(1);
var FirstLocaleKeyUpdated = ((JArray)checkPUTWorked.ObjectResponse["data"])[0];
FirstLocaleKeyUpdated["value"].Value<string>().Should().Be(d2.newText.ToString());

View File

@@ -20,7 +20,7 @@ namespace raven_integration
//And doesn't exists if server was not debug built
ApiResponse a = await Util.GetAsync("BuildMode");
Util.ValidateDataReturnResponseOk(a);
var BuildMode = a.ObjectResponse["result"]["buildMode"].Value<string>();
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
BuildMode.Should().BeOneOf((new string[] { "DEBUG", "RELEASE" }));
if (BuildMode == "DEBUG")
@@ -38,21 +38,21 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200);
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
((JArray)a.ObjectResponse["result"]).Count.Should().Be(2);
((JArray)a.ObjectResponse["data"]).Count.Should().Be(2);
//Now ensure there are at least two keys in the fetched keys array
a = await Util.GetAsync("Locale/LocaleKeyCoverage", await Util.GetTokenAsync("ClientLimited"));
Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200);
var RequestedKeyCount = a.ObjectResponse["result"]["requestedKeyCount"].Value<int>();
var RequestedKeyCount = a.ObjectResponse["data"]["requestedKeyCount"].Value<int>();
RequestedKeyCount.Should().BeGreaterOrEqualTo(2);
var NotRequestedKeyCount = a.ObjectResponse["result"]["notRequestedKeyCount"].Value<int>();
var NotRequestedKeyCount = a.ObjectResponse["data"]["notRequestedKeyCount"].Value<int>();
NotRequestedKeyCount.Should().BeGreaterThan(1);//For now at least, once we have this dialed in it will be zero ultimately
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
((JArray)a.ObjectResponse["result"]["requestedKeys"]).Count.Should().Be(RequestedKeyCount);
((JArray)a.ObjectResponse["result"]["notRequestedKeys"]).Count.Should().Be(NotRequestedKeyCount);
((JArray)a.ObjectResponse["data"]["requestedKeys"]).Count.Should().Be(RequestedKeyCount);
((JArray)a.ObjectResponse["data"]["notRequestedKeys"]).Count.Should().Be(NotRequestedKeyCount);
}
}