This commit is contained in:
2020-02-14 22:42:40 +00:00
parent 9d103f9d78
commit 08253b6623

View File

@@ -93,16 +93,28 @@ namespace raven_integration
d.listKey = "nonexistant";
//"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
dynamic dfilter = new JArray();
dynamic df = new JObject();
df.fld = "name";
df.op = "%-";
df.value = "Generic";//lots of seed widgets start with Generic
dfilter.Add(df);
// dynamic dfilter = new JArray();
// dynamic df = new JObject();
// df.fld = "name";
// df.op = "%-";
// df.value = "Generic";//lots of seed widgets start with Generic
// dfilter.Add(df);
d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
// d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
// ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
dynamic dListView = new JArray();
// dynamic df = new JObject();
// df.fld = "widgetname";
// df.op = "%-";
// df.value = "Generic";//lots of seed widgets start with Generic
// dListView.Add(df);
// d.filter = dListView.ToString();//it expects it to be a json string, not actual json
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, "Generic"));
d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "ListKey", "2203");
@@ -123,18 +135,29 @@ namespace raven_integration
d.listKey="TestWidgetDataList";
//"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
dynamic dfilter = new JArray();
dynamic df = new JObject();
df.fld = "doesntexist";
df.op = "%-";
df.value = "Generic";//lots of seed widgets start with Generic
dfilter.Add(df);
// dynamic dfilter = new JArray();
// dynamic df = new JObject();
// df.fld = "doesntexist";
// df.op = "%-";
// df.value = "Generic";//lots of seed widgets start with Generic
// dfilter.Add(df);
d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
// d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
// ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
dynamic dListView = new JArray();
// dynamic df = new JObject();
// df.fld = "widgetname";
// df.op = "%-";
// df.value = "Generic";//lots of seed widgets start with Generic
// dListView.Add(df);
// d.filter = dListView.ToString();//it expects it to be a json string, not actual json
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("doesntexist", Util.OpStartsWith, "Generic"));
d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
ApiResponse a = await Util.PostAsync("DataListView", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "Filter", "2203");
Util.ShouldContainValidationError(a, "ListView", "2203");
}