This commit is contained in:
@@ -73,7 +73,6 @@ namespace raven_integration
|
||||
df.fld = "DOES_NOT_EXIST";//<-- ERROR BAD FIELD NAME
|
||||
dTemplateArray.Add(df);
|
||||
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
//replace the User template at the server
|
||||
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||
//"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template array item 0, fld property value \\\"DOES_NOT_EXIST\\\" is not a valid value for AyaType specified\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}"
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
@@ -104,7 +103,6 @@ namespace raven_integration
|
||||
df.fld = "useremployeenumber";
|
||||
dTemplateArray.Add(df);
|
||||
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
//replace the User template at the server
|
||||
//ERROR NO RIGHTS USER
|
||||
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("CustomerLimited"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||
//"{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}"
|
||||
@@ -126,42 +124,28 @@ namespace raven_integration
|
||||
df = new JObject();
|
||||
df.fld = "useremployeenumber";
|
||||
dTemplateArray.Add(df);
|
||||
string sTemplate=dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
d.Template = sTemplate.Substring(2);//<-- ERROR missing first two characters of json template array
|
||||
//replace the User template at the server
|
||||
string sTemplate = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
d.Template = sTemplate.Substring(2);//<-- ERROR missing first two characters of json template array
|
||||
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||
//"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template is not valid JSON string: Error reading JArray from JsonReader. Current JsonReader item is not an array: String. Path '', line 1, position 5.\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}"
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
Util.ShouldContainValidationError(a, "Template", "2203");
|
||||
|
||||
}
|
||||
|
||||
//malformed template bad json?
|
||||
|
||||
|
||||
// //UPDATE
|
||||
|
||||
// //PUT, make private
|
||||
// d["public"] = false;
|
||||
// d.name = Util.Uniquify("Put - Test DataListView (privatized)");
|
||||
// d.concurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
// a = await Util.PutAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
// Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
// //check PUT worked
|
||||
// a = await Util.GetAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
// Util.ValidateNoErrorInResponse(a);
|
||||
// a.ObjectResponse["data"]["name"].Value<string>().Should().Be(d.name.ToString());
|
||||
|
||||
|
||||
// //FETCH DISALLOWED
|
||||
// //Get as alternate user should fail for private filter
|
||||
// a = await Util.GetAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("SubContractorLimited"));
|
||||
// Util.ValidateResponseNotFound(a);
|
||||
|
||||
// // //DELETE
|
||||
// ApiResponse DELETETestResponse = await Util.DeleteAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
// Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
/// <summary>
|
||||
/// test get templates list
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void UserPickListTemplateList()
|
||||
{
|
||||
//RETRIEVE
|
||||
ApiResponse a = await Util.GetAsync("PickList/TemplateList", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//assert contains at least two records (as we only have two at time of writing this test)
|
||||
var templateList = ((JArray)a.ObjectResponse["data"]);
|
||||
templateList.Count.Should().BeGreaterThan(1);
|
||||
templateList[0]["id"].Value<long>().Should().Be(2);//first one should be a widget
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
|
||||
Reference in New Issue
Block a user