This commit is contained in:
@@ -3705,5 +3705,63 @@ same as the server does but in a central location here for all tests to use.
|
||||
#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
|
||||
}//eons
|
||||
|
||||
Reference in New Issue
Block a user