This commit is contained in:
@@ -40,7 +40,7 @@ namespace raven_integration
|
||||
*/
|
||||
|
||||
dynamic d = new JObject();
|
||||
d.formkey = "user";
|
||||
d.formkey = "User";
|
||||
|
||||
dynamic dtemplate = new JArray();
|
||||
|
||||
@@ -69,23 +69,23 @@ namespace raven_integration
|
||||
|
||||
//RETRIEVE
|
||||
//Get the current one (server will create if non-existent)
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/user", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
|
||||
//Update
|
||||
d.concurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
a = await Util.PutAsync("FormCustom/user", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
a = await Util.PutAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
//check the concurrency token cache scheme
|
||||
uint token = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
//This should return a 304 not modified
|
||||
a = await Util.GetAsync($"FormCustom/user?concurrencyToken={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"FormCustom/User?concurrencyToken={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 304);
|
||||
|
||||
//and this should return the whole object
|
||||
token--;//make the token not match
|
||||
//This should return a 200 and the whole object
|
||||
a = await Util.GetAsync($"FormCustom/user?concurrencyToken={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"FormCustom/User?concurrencyToken={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace raven_integration
|
||||
{
|
||||
|
||||
dynamic d = new JObject();
|
||||
d.formkey = "user";
|
||||
d.formkey = "User";
|
||||
|
||||
dynamic dtemplate = new JArray();
|
||||
|
||||
@@ -153,11 +153,11 @@ namespace raven_integration
|
||||
|
||||
//RETRIEVE
|
||||
//Get the current one (server will create if non-existent)
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/user", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
|
||||
//Update
|
||||
d.concurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
a = await Util.PutAsync("FormCustom/user", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
a = await Util.PutAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
Util.ValidateHTTPStatusCode(a, 400);
|
||||
Util.ShouldContainValidationError(a, "Template", "2201", "Template array item 0, \"fld\" property exists but is empty, a value is required");
|
||||
Util.ShouldContainValidationError(a, "Template", "2203", "Template array item 0, fld property value \"\" is not a valid form field value for formKey specified");
|
||||
@@ -200,7 +200,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void ObjectFieldsWorks()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("FormFieldsDefinitions/widget", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("FormFieldsDefinitions/Widget", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(25);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user