From d2bdcd6ee18d588a1515cd8f07dac18eb9e2018c Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 12 Feb 2020 00:15:31 +0000 Subject: [PATCH] --- DataList/DataListFiltering.cs | 164 +--------------------------------- 1 file changed, 1 insertion(+), 163 deletions(-) diff --git a/DataList/DataListFiltering.cs b/DataList/DataListFiltering.cs index 6db4713..54307a0 100644 --- a/DataList/DataListFiltering.cs +++ b/DataList/DataListFiltering.cs @@ -928,12 +928,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -992,10 +986,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -1054,12 +1044,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1118,10 +1102,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } /// @@ -1177,12 +1157,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1198,14 +1172,6 @@ same as the server does but in a central location here for all tests to use. DataFilterActive.op = Util.OpEquality; DataFilterActive.value = "Bill & Ted's excellent adventure"; dfilter.Add(DataFilterActive); - - d.filter = dfilter.ToString();//it expects it to be a json string, not actual json - - a = await Util.PostAsync("DataListFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString()); - Util.ValidateDataReturnResponseOk(a); - - long DataFilterId = a.ObjectResponse["data"]["id"].Value(); - //NOW FETCH WIDGET LIST WITH FILTER a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequest(dfilter)); Util.ValidateDataReturnResponseOk(a); @@ -1217,13 +1183,7 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - // foreach (JObject o in v) - // { - // if (InclusiveWidgetIdList.Contains(o["id"].Value())) - // InclusiveMatchCount++; - // if (ExclusiveWidgetIdList.Contains(o["id"].Value())) - // ExclusiveMatchCount++; - // } + foreach (JArray ja in v) { @@ -1250,10 +1210,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } /// @@ -1310,12 +1266,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1374,10 +1324,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -1434,12 +1380,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1498,10 +1438,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -1558,12 +1494,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1622,10 +1552,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -1682,12 +1608,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1746,10 +1666,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -1806,12 +1722,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1870,10 +1780,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } /// @@ -1929,12 +1835,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -1993,10 +1893,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -2052,12 +1948,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -2116,10 +2006,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -2175,12 +2061,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -2196,14 +2076,6 @@ same as the server does but in a central location here for all tests to use. DataFilterActive.op = Util.OpContains; DataFilterActive.value = "red"; dfilter.Add(DataFilterActive); - - d.filter = dfilter.ToString();//it expects it to be a json string, not actual json - - a = await Util.PostAsync("DataListFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString()); - Util.ValidateDataReturnResponseOk(a); - - long DataFilterId = a.ObjectResponse["data"]["id"].Value(); - //NOW FETCH WIDGET LIST WITH FILTER a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequest(dfilter)); Util.ValidateDataReturnResponseOk(a); @@ -2239,10 +2111,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); } @@ -2298,12 +2166,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -2363,10 +2225,6 @@ same as the server does but in a central location here for all tests to use. Util.ValidateHTTPStatusCode(a, 204); } - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); - } @@ -2422,12 +2280,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -2487,10 +2339,6 @@ same as the server does but in a central location here for all tests to use. Util.ValidateHTTPStatusCode(a, 204); } - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); - } @@ -3985,12 +3833,6 @@ same as the server does but in a central location here for all tests to use. //CREATE FILTER - dynamic d = new JObject(); - d.name = Util.Uniquify(WidgetRunNameStart); - - d["public"] = true; - d.listKey = "TestWidgetDataList"; - dynamic dfilter = new JArray(); //name starts with filter to constrict to widgets that this test block created only @@ -4052,10 +3894,6 @@ same as the server does but in a central location here for all tests to use. a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204); } - - //DELETE DATAFILTER - a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull")); - Util.ValidateHTTPStatusCode(a, 204); }