diff --git a/PickList/PickListAllTests.cs b/PickList/PickListAllTests.cs index 028a60a..e399faf 100644 --- a/PickList/PickListAllTests.cs +++ b/PickList/PickListAllTests.cs @@ -63,13 +63,29 @@ namespace raven_integration templateArray[0]["fld"].Value().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