This commit is contained in:
2020-03-17 23:02:42 +00:00
parent 16211c9259
commit 5e3164a876

View File

@@ -63,13 +63,29 @@ namespace raven_integration
templateArray[0]["fld"].Value<string>().Should().Be("username"); ;
//Now test error conditions....
//Now test error conditions....
//bad field name
//no such list
//no rights? (might need to make some changes at server, right now maybe anyone can modify template (bad))
//empty template
//malformed template bad json?
d = new JObject();
d.Id = 3;//User type
//template, simple test, nothing fancy
dTemplateArray = new JArray();
df = new JObject();
df.fld = "DOES_NOT_EXIST";
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);
Util.ShouldContainValidationError(a, "Template", "2203");
//bad field name
//no such list
//no rights? (might need to make some changes at server, right now maybe anyone can modify template (bad))
//empty template
//malformed template bad json?
// //UPDATE