From b691e29ad3070b9093646b7141871765f71c9a38 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 18 Mar 2020 19:45:10 +0000 Subject: [PATCH] --- Translation/Translation.cs | 4 +- User/UserCrud.cs | 151 ------------------------------------- 2 files changed, 2 insertions(+), 153 deletions(-) diff --git a/Translation/Translation.cs b/Translation/Translation.cs index 5372ba7..096c98a 100644 --- a/Translation/Translation.cs +++ b/Translation/Translation.cs @@ -20,10 +20,10 @@ namespace raven_integration */ [Fact] - public async void TranslationPickListWorks() + public async void TranslationListWorks() { //Get all - ApiResponse a = await Util.GetAsync("Translation/picklist", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated + ApiResponse a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated Util.ValidateDataReturnResponseOk(a); Util.ValidateHTTPStatusCode(a, 200); //there should be at least 4 of them as there are 4 stock translations diff --git a/User/UserCrud.cs b/User/UserCrud.cs index f724cbe..74c8b74 100644 --- a/User/UserCrud.cs +++ b/User/UserCrud.cs @@ -465,157 +465,6 @@ namespace raven_integration } - - //DEPRECATED THESE BECAUSE THEY DON'T TEST ANYTHING UNIQUELY THAT ISN'T ALREADY COVERED BY THE DATALISTFILTER AND ORDER BY TESTS ELSEWHERE - //AND THE PICKLIST IS NOW MINI FORMAT OF REGULAR LIST - // /// - // /// - // /// - // [Fact] - // public async void UserPickListDefaultSortNoFilterWorks() - // { - // var RouteName = "User";//########## - - // //NOW FETCH LIST WITH FILTER - // ApiResponse a = await Util.GetAsync($"{RouteName}/picklist?Offset=0&Limit=999", await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateDataReturnResponseOk(a); - // Util.ValidateHTTPStatusCode(a, 200); - - // //assert contains at least 3 records - // var ItemCount = ((JArray)a.ObjectResponse["data"]).Count; - // ItemCount.Should().BeGreaterOrEqualTo(3); - - // var firstName = a.ObjectResponse["data"][0]["name"].Value().Replace(" ", ""); - // var secondName = a.ObjectResponse["data"][1]["name"].Value().Replace(" ", ""); - // int comparison = String.Compare(firstName, secondName, comparisonType: StringComparison.OrdinalIgnoreCase); - // comparison.Should().BeNegative(); - // } - - - - // /// - // /// - // /// - // [Fact] - // public async void UserPickListSortByFieldAscendingWorks() - // { - - // var NameStart = Util.Uniquify("UserPickListSortByFieldAscendingWorks"); - - // //CREATE 3 TEST objects TO TEST ORDER - // long FirstInOrderId = 0; - // long SecondInOrderId = 0; - // long ThirdInOrderId = 0; - - // dynamic d = new JObject(); - // d.name = Util.Uniquify(NameStart); - // d.active = false; - // d.login = Util.Uniquify("LOGIN"); - // d.password = Util.Uniquify("PASSWORD"); - // d.roles = 0;//norole - // - // d.userType = 3;//non scheduleable - // //Required by form custom rules - // d.notes = "notes"; - // d.customFields = Util.UserRequiredCustomFieldsJsonString(); - - - // ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString()); - // Util.ValidateDataReturnResponseOk(a); - // ThirdInOrderId = a.ObjectResponse["data"]["id"].Value(); - - // d = new JObject(); - // d.name = Util.Uniquify(NameStart); - // d.active = true; - // d.login = Util.Uniquify("LOGIN"); - // d.password = Util.Uniquify("PASSWORD"); - // d.roles = 0;//norole - // - // d.userType = 2;//non scheduleable - // //Required by form custom rules - // d.notes = "notes"; - // d.customFields = Util.UserRequiredCustomFieldsJsonString(); - - // a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString()); - // Util.ValidateDataReturnResponseOk(a); - // SecondInOrderId = a.ObjectResponse["data"]["id"].Value(); - - // d = new JObject(); - // d.name = Util.Uniquify(NameStart); - // d.active = false; - // d.login = Util.Uniquify("LOGIN"); - // d.password = Util.Uniquify("PASSWORD"); - // d.roles = 0;//norole - // - // d.userType = 1;//non scheduleable - // //Required by form custom rules - // d.notes = "notes"; - // d.customFields = Util.UserRequiredCustomFieldsJsonString(); - - // a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString()); - // Util.ValidateDataReturnResponseOk(a); - // FirstInOrderId = a.ObjectResponse["data"]["id"].Value(); - - - // //CREATE FILTER - // d = new JObject(); - // d.name = Util.Uniquify(NameStart); - // d["public"] = true; - // d.listKey = "user"; - - // //FILTER IN BY NAME FOR TESTING THIS RUN ONLY - // dynamic dfilter = new JArray(); - // //name starts with filter to constrict to widgets that this test block created only - // dynamic DataFilterNameStart = new JObject(); - // DataFilterNameStart.fld = "name"; - // DataFilterNameStart.op = Util.OpStartsWith; - // DataFilterNameStart.value = NameStart; - // dfilter.Add(DataFilterNameStart); - // d.filter = dfilter.ToString(); - - // //SORT ORDER ################### - // dynamic dsortarray = new JArray(); - // dynamic dsort = new JObject(); - // dsort.fld = "usertype"; - // dsort.dir = "+"; - // dsortarray.Add(dsort); - // d.sort = dsortarray.ToString(); - - // a = await Util.PostAsync("DataListFilter", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString()); - // Util.ValidateDataReturnResponseOk(a); - - // long DataFilterId = a.ObjectResponse["data"]["id"].Value(); - - // //NOW FETCH WIDGET LIST WITH FILTER - // a = await Util.GetAsync($"User/picklist?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateDataReturnResponseOk(a); - // Util.ValidateHTTPStatusCode(a, 200); - - // //assert contains exactly 3 records - // ((JArray)a.ObjectResponse["data"]).Count.Should().Be(3); - - // //assert the order returned - // a.ObjectResponse["data"][0]["id"].Value().Should().Be(FirstInOrderId); - // a.ObjectResponse["data"][1]["id"].Value().Should().Be(SecondInOrderId); - // a.ObjectResponse["data"][2]["id"].Value().Should().Be(ThirdInOrderId); - - - // a = await Util.DeleteAsync("User/" + FirstInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateHTTPStatusCode(a, 204); - - // a = await Util.DeleteAsync("User/" + SecondInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateHTTPStatusCode(a, 204); - - // a = await Util.DeleteAsync("User/" + ThirdInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateHTTPStatusCode(a, 204); - - // //DELETE DATAFILTER - // a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); - // Util.ValidateHTTPStatusCode(a, 204); - - // } - - //================================================== }//eoc