This commit is contained in:
@@ -659,7 +659,7 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
|
|
||||||
dynamic filter = new JObject();
|
dynamic filter = new JObject();
|
||||||
dynamic items = new JArray();
|
dynamic items = new JArray();
|
||||||
|
|
||||||
dynamic fitem = new JObject();
|
dynamic fitem = new JObject();
|
||||||
fitem.op = Util.OpGreaterThanOrEqualTo;
|
fitem.op = Util.OpGreaterThanOrEqualTo;
|
||||||
fitem.value = new DateTime(2019, 3, 12, 10, 0, 0).ToOffsetAdjustedUniversalTime();
|
fitem.value = new DateTime(2019, 3, 12, 10, 0, 0).ToOffsetAdjustedUniversalTime();
|
||||||
@@ -675,10 +675,10 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
d.filter = filter;
|
d.filter = filter;
|
||||||
|
|
||||||
dListView.Add(d);
|
dListView.Add(d);
|
||||||
/*
|
/*
|
||||||
"SELECT awidget.id AS df, awidget.name, awidget.id, awidget.startdate from awidget left outer join auser on (awidget.userid=auser.id) where (awidget.name Like 'DateOpBetweenFilterWorks%') AND ((awidget.startdate >='2019-03-12T18:00:00.0000000') AND awidget.startdate Is Null OR awidget.startdate <='2019-03-12T19:00:00.9990000Z')) ORDER BY awidget.id DESC LIMIT 999 OFFSET 0"
|
"SELECT awidget.id AS df, awidget.name, awidget.id, awidget.startdate from awidget left outer join auser on (awidget.userid=auser.id) where (awidget.name Like 'DateOpBetweenFilterWorks%') AND ((awidget.startdate >='2019-03-12T18:00:00.0000000') AND awidget.startdate Is Null OR awidget.startdate <='2019-03-12T19:00:00.9990000Z')) ORDER BY awidget.id DESC LIMIT 999 OFFSET 0"
|
||||||
" where (awidget.name Like 'DateOpBetweenFilterWorks%') AND ((awidget.startdate >='2019-03-12T18:00:00.0000000') AND awidget.startdate Is Null OR awidget.startdate <='2019-03-12T19:00:00.9990000Z'))"
|
" where (awidget.name Like 'DateOpBetweenFilterWorks%') AND ((awidget.startdate >='2019-03-12T18:00:00.0000000') AND awidget.startdate Is Null OR awidget.startdate <='2019-03-12T19:00:00.9990000Z'))"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//FETCH DATALIST
|
//FETCH DATALIST
|
||||||
@@ -3705,5 +3705,63 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
#endregion tag tests
|
#endregion tag tests
|
||||||
//==================================================
|
//==================================================
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
//FILTER BY ID VALUE
|
||||||
|
//
|
||||||
|
#region ID FILTER TESTS
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public async void IdFilterWorks()
|
||||||
|
{
|
||||||
|
|
||||||
|
var TestName = "IdFilterWorks";
|
||||||
|
var WidgetNameStart = Util.Uniquify(TestName);
|
||||||
|
|
||||||
|
//CREATE WIDGET
|
||||||
|
dynamic w = new JObject();
|
||||||
|
w.name = Util.Uniquify(WidgetNameStart);
|
||||||
|
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
|
w.notes = "ID FILTER NOTES";
|
||||||
|
w.usertype = 1;
|
||||||
|
|
||||||
|
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
long Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
|
//CREATE LISTVIEW
|
||||||
|
dynamic dListView = new JArray();
|
||||||
|
//FILTER
|
||||||
|
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpEquality, Id));
|
||||||
|
//FETCH DATALIST
|
||||||
|
a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||||
|
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
|
//assert contains ONE record ONLY
|
||||||
|
((JArray)a.ObjectResponse["data"]).Count.Should().Be(1);
|
||||||
|
//assert it's ours
|
||||||
|
((JArray)a.ObjectResponse["data"])[0][0]["v"].Value<long>().Should().Be(Id);
|
||||||
|
// v[0]["v"].Value<long>()
|
||||||
|
|
||||||
|
//DELETE WIDGET
|
||||||
|
a = await Util.DeleteAsync("Widget/" + Id.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||||
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion ID filter tests
|
||||||
|
//==================================================
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
|
|||||||
Reference in New Issue
Block a user