From 24d0585162461206be1fd58fea2fa742ef746a7a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 17 Mar 2020 19:38:40 +0000 Subject: [PATCH] --- PickList/PickListAllTests.cs | 26 +++++++++++--------------- util.cs | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/PickList/PickListAllTests.cs b/PickList/PickListAllTests.cs index 0610d3c..3045d76 100644 --- a/PickList/PickListAllTests.cs +++ b/PickList/PickListAllTests.cs @@ -30,28 +30,24 @@ namespace raven_integration //template, simple test, nothing fancy dynamic dTemplateArray = new JArray(); dynamic df = new JObject(); - df.fld = "useremployeenumber"; + df.fld = "useremployeenumber"; dTemplateArray.Add(df); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); //replace the User template at the server ApiResponse a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); - Util.ValidateHTTPStatusCode(a, 204); - // Util.ValidateDataReturnResponseOk(a); + Util.ValidateHTTPStatusCode(a, 204); - - // //RETRIEVE - // //Get one - // a = await Util.GetAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("BizAdminFull")); - // Util.ValidateDataReturnResponseOk(a); - // a.ObjectResponse["data"]["name"].Value().Should().StartWith("Test DataListView"); - - // //Get as alternate user should work for public filter - // a = await Util.GetAsync("DataListView/" + Id.ToString(), await Util.GetTokenAsync("SubContractorLimited")); - // Util.ValidateDataReturnResponseOk(a); - // a.ObjectResponse["data"]["name"].Value().Should().StartWith("Test DataListView"); - + //RETRIEVE + //Get one + a = await Util.GetAsync("PickList/Template/3/", await Util.GetTokenAsync("BizAdminFull")); + Util.ValidateDataReturnResponseOk(a); + //assert contains ONE record ONLY and it's the one we set + var templateArray=JArray.Parse(a.ObjectResponse["data"]["template"].Value()); + templateArray.Count.Should().Be(1); + templateArray[0]["fld"].Value().Should().Be("useremployeenumber");; + // //UPDATE diff --git a/util.cs b/util.cs index 42bf33d..9eb3306 100644 --- a/util.cs +++ b/util.cs @@ -305,7 +305,7 @@ namespace raven_integration /// /// /// - private static JObject Parse(string jsonString) + public static JObject Parse(string jsonString) { if (string.IsNullOrWhiteSpace(jsonString)) {