diff --git a/PickList/PickListAllTests.cs b/PickList/PickListAllTests.cs index cb81471..473e987 100644 --- a/PickList/PickListAllTests.cs +++ b/PickList/PickListAllTests.cs @@ -119,7 +119,22 @@ namespace raven_integration Util.ShouldContainValidationError(a, "Template", "2201"); - //empty template + //MALFORMED TEMPLATE JSON ERROR + d = new JObject(); + d.Id = 3;//User type + dTemplateArray = new JArray(); + 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 + 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?