This commit is contained in:
@@ -11,7 +11,7 @@ namespace raven_integration
|
||||
|
||||
public class DataFilterOrderBy
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -28,7 +28,7 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -36,7 +36,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -44,7 +44,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -55,13 +55,13 @@ namespace raven_integration
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify(WidgetNameStart);
|
||||
d["public"] = true;
|
||||
d.listKey="TestWidgetDataList";
|
||||
d.listKey = "TestWidgetDataList";
|
||||
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.fld = "widgetname";
|
||||
DataFilterNameStart.op = Util.OpStartsWith;
|
||||
DataFilterNameStart.value = WidgetNameStart;
|
||||
dfilter.Add(DataFilterNameStart);
|
||||
@@ -73,7 +73,7 @@ namespace raven_integration
|
||||
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.GetAsync($"Widget/listwidgets?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace raven_integration
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||
|
||||
//assert the order returned
|
||||
a.ObjectResponse["data"][0]["id"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1]["id"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2]["id"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
a.ObjectResponse["data"][0][0]["v"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1][0]["v"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2][0]["v"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
@@ -118,7 +118,7 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now;
|
||||
w.endDate = DateTime.Now.AddHours(1);
|
||||
@@ -129,7 +129,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now.AddHours(1);
|
||||
w.endDate = DateTime.Now.AddHours(2);
|
||||
@@ -139,7 +139,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now.AddHours(2);
|
||||
w.endDate = DateTime.Now.AddHours(3);
|
||||
@@ -152,13 +152,13 @@ namespace raven_integration
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify(WidgetNameStart);
|
||||
d["public"] = true;
|
||||
d.listKey="TestWidgetDataList";
|
||||
d.listKey = "TestWidgetDataList";
|
||||
|
||||
//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.fld = "widgetname";
|
||||
DataFilterNameStart.op = Util.OpStartsWith;
|
||||
DataFilterNameStart.value = WidgetNameStart;
|
||||
dfilter.Add(DataFilterNameStart);
|
||||
@@ -167,7 +167,7 @@ namespace raven_integration
|
||||
//SORT ORDER ###################
|
||||
dynamic dsortarray = new JArray();
|
||||
dynamic dsort = new JObject();
|
||||
dsort.fld = "startdate";
|
||||
dsort.fld = "widgetstartdate";
|
||||
dsort.dir = "+";
|
||||
dsortarray.Add(dsort);
|
||||
d.sort = dsortarray.ToString();
|
||||
@@ -178,7 +178,7 @@ namespace raven_integration
|
||||
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.GetAsync($"Widget/listwidgets?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -186,9 +186,9 @@ namespace raven_integration
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||
|
||||
//assert the order returned
|
||||
a.ObjectResponse["data"][0]["id"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1]["id"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2]["id"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
a.ObjectResponse["data"][0][0]["v"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1][0]["v"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2][0]["v"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
@@ -224,7 +224,7 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.count = 999;
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.count = 665;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -243,7 +243,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.count = 333;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -255,13 +255,13 @@ namespace raven_integration
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify(WidgetNameStart);
|
||||
d["public"] = true;
|
||||
d.listKey="TestWidgetDataList";
|
||||
d.listKey = "TestWidgetDataList";
|
||||
|
||||
//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.fld = "widgetname";
|
||||
DataFilterNameStart.op = Util.OpStartsWith;
|
||||
DataFilterNameStart.value = WidgetNameStart;
|
||||
dfilter.Add(DataFilterNameStart);
|
||||
@@ -270,7 +270,7 @@ namespace raven_integration
|
||||
//SORT ORDER ###################
|
||||
dynamic dsortarray = new JArray();
|
||||
dynamic dsort = new JObject();
|
||||
dsort.fld = "count";
|
||||
dsort.fld = "widgetcount";
|
||||
dsort.dir = "-";
|
||||
dsortarray.Add(dsort);
|
||||
d.sort = dsortarray.ToString();
|
||||
@@ -281,7 +281,7 @@ namespace raven_integration
|
||||
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.GetAsync($"Widget/listwidgets?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -289,9 +289,9 @@ namespace raven_integration
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||
|
||||
//assert the order returned
|
||||
a.ObjectResponse["data"][0]["id"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1]["id"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2]["id"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
a.ObjectResponse["data"][0][0]["v"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1][0]["v"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2][0]["v"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
@@ -347,7 +347,7 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 2.22;
|
||||
w.count = 1;
|
||||
@@ -358,7 +358,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 2;
|
||||
@@ -368,7 +368,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 1;
|
||||
@@ -378,7 +378,7 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 2.22;
|
||||
w.count = 2;
|
||||
@@ -391,13 +391,13 @@ namespace raven_integration
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify(WidgetNameStart);
|
||||
d["public"] = true;
|
||||
d.listKey="TestWidgetDataList";
|
||||
d.listKey = "TestWidgetDataList";
|
||||
|
||||
//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.fld = "widgetname";
|
||||
DataFilterNameStart.op = Util.OpStartsWith;
|
||||
DataFilterNameStart.value = WidgetNameStart;
|
||||
dfilter.Add(DataFilterNameStart);
|
||||
@@ -408,13 +408,13 @@ namespace raven_integration
|
||||
|
||||
//First column
|
||||
dynamic dsort1 = new JObject();
|
||||
dsort1.fld = "dollaramount";
|
||||
dsort1.fld = "widgetdollaramount";
|
||||
dsort1.dir = "+";
|
||||
dsortarray.Add(dsort1);
|
||||
|
||||
//Second column
|
||||
dynamic dsort2 = new JObject();
|
||||
dsort2.fld = "count";
|
||||
dsort2.fld = "widgetcount";
|
||||
dsort2.dir = "-";
|
||||
dsortarray.Add(dsort2);
|
||||
|
||||
@@ -427,7 +427,7 @@ namespace raven_integration
|
||||
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.GetAsync($"Widget/listwidgets?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -435,10 +435,10 @@ namespace raven_integration
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(4);
|
||||
|
||||
//assert the order returned
|
||||
a.ObjectResponse["data"][0]["id"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1]["id"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2]["id"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
a.ObjectResponse["data"][3]["id"].Value<long>().Should().Be(FourthInOrderWidgetId);
|
||||
a.ObjectResponse["data"][0][0]["v"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||
a.ObjectResponse["data"][1][0]["v"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||
a.ObjectResponse["data"][2][0]["v"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
a.ObjectResponse["data"][3][0]["v"].Value<long>().Should().Be(FourthInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
|
||||
Reference in New Issue
Block a user