This commit is contained in:
@@ -3986,116 +3986,6 @@ same as the server does but in a central location here for all tests to use.
|
||||
}
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// [Fact]
|
||||
// public async void BoolOpNotEqualFilterWorks()
|
||||
// {
|
||||
|
||||
// //OPS: equal to, not equal to
|
||||
// //values: true, false
|
||||
|
||||
// var WidgetNameStart = "BoolDataFilterTest";
|
||||
|
||||
// List<long> ActiveWidgetIdList = new List<long>();
|
||||
// List<long> NotActiveWidgetIdList = new List<long>();
|
||||
|
||||
// //CREATE 4 TEST WIDGETS
|
||||
// //two active and two non active
|
||||
|
||||
// //first active widget
|
||||
// dynamic w = new JObject();
|
||||
// w.name = Util.Uniquify(WidgetNameStart);
|
||||
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
// w.notes = "blah";
|
||||
// w.active = true;
|
||||
// w.usertype = 1;
|
||||
|
||||
// ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// ActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
// //second active widget
|
||||
// w.name = Util.Uniquify(WidgetNameStart);
|
||||
|
||||
// a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// ActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
|
||||
// //first NON active widget
|
||||
// w.name = Util.Uniquify(WidgetNameStart);
|
||||
// w.active = false;
|
||||
|
||||
// a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// NotActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
// //second NON active widget
|
||||
// w.name = Util.Uniquify(WidgetNameStart);
|
||||
// w.active = false;
|
||||
|
||||
// a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// NotActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
|
||||
// //CREATE LISTVIEW
|
||||
// dynamic dListView = new JArray();
|
||||
|
||||
// //name starts with filter to constrict to widgets that this test block created only
|
||||
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
||||
|
||||
// //FILTER
|
||||
// // dynamic DataFilterActive = new JObject();
|
||||
// // DataFilterActive.fld = "widgetactive";
|
||||
// // DataFilterActive.op = Util.OpNotEqual;
|
||||
// // DataFilterActive.value = true;
|
||||
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetactive", Util.OpNotEqual, true));
|
||||
|
||||
|
||||
|
||||
// //FETCH DATALIST
|
||||
// a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
// //assert contains at least two records
|
||||
// ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);
|
||||
// var v = ((JArray)a.ObjectResponse["data"]);
|
||||
// List<long> IDInResultList = new List<long>();
|
||||
// int nActiveMatches = 0;
|
||||
// int nInactiveMatches = 0;
|
||||
|
||||
// foreach (JArray ja in v)
|
||||
// {
|
||||
// JObject o = ja[0] as JObject;
|
||||
|
||||
// if (ActiveWidgetIdList.Contains(o["i"].Value<long>()))
|
||||
// nActiveMatches++;
|
||||
// if (NotActiveWidgetIdList.Contains(o["i"].Value<long>()))
|
||||
// nInactiveMatches++;
|
||||
// }
|
||||
|
||||
// nInactiveMatches.Should().Be(NotActiveWidgetIdList.Count);
|
||||
// nActiveMatches.Should().Be(0);
|
||||
|
||||
// //DELETE WIDGETS
|
||||
// foreach (long l in ActiveWidgetIdList)
|
||||
// {
|
||||
// a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
// Util.ValidateHTTPStatusCode(a, 204);
|
||||
// }
|
||||
|
||||
// foreach (long l in NotActiveWidgetIdList)
|
||||
// {
|
||||
// a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
// Util.ValidateHTTPStatusCode(a, 204);
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
|
||||
#endregion *NULL* tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user