This commit is contained in:
@@ -28,7 +28,7 @@ namespace raven_integration
|
|||||||
|
|
||||||
//Make a "list" of keys to fetch the values for
|
//Make a "list" of keys to fetch the values for
|
||||||
List<string> keys = new List<string>();
|
List<string> keys = new List<string>();
|
||||||
keys.AddRange(new string[] { "HelpLicense", "ClientName" });
|
keys.AddRange(new string[] { "HelpLicense", "CustomerName" });
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
|
|
||||||
d = JToken.FromObject(keys);
|
d = JToken.FromObject(keys);
|
||||||
|
|||||||
188
User/UserCrud.cs
188
User/UserCrud.cs
@@ -302,127 +302,127 @@ namespace raven_integration
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//This is testing datalist, not user crud, removing
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// [Fact]
|
||||||
|
// public async void UserListFilterAndSortWorks()
|
||||||
|
// {
|
||||||
|
|
||||||
/// <summary>
|
// var ObjectNameStart = Util.Uniquify("UserListFilterAndSortWorks");
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public async void UserListFilterAndSortWorks()
|
|
||||||
{
|
|
||||||
|
|
||||||
var ObjectNameStart = Util.Uniquify("UserListFilterAndSortWorks");
|
// //CREATE 3 TEST OBJECTS TO TEST ORDER
|
||||||
|
// long FirstInOrdertId = 0;
|
||||||
|
// long SecondInOrderId = 0;
|
||||||
|
// long ThirdInOrderId = 0;
|
||||||
|
|
||||||
//CREATE 3 TEST OBJECTS TO TEST ORDER
|
// dynamic d = new JObject();
|
||||||
long FirstInOrdertId = 0;
|
// d.name = Util.Uniquify(ObjectNameStart);
|
||||||
long SecondInOrderId = 0;
|
// d.active = false;
|
||||||
long ThirdInOrderId = 0;
|
// d.login = Util.Uniquify("LOGIN");
|
||||||
|
// d.password = Util.Uniquify("PASSWORD");
|
||||||
|
// d.roles = 0;//norole
|
||||||
|
|
||||||
dynamic d = new JObject();
|
// d.userType = 3;//non scheduleable
|
||||||
d.name = Util.Uniquify(ObjectNameStart);
|
// //Required by form custom rules
|
||||||
d.active = false;
|
// d.notes = "notes";
|
||||||
d.login = Util.Uniquify("LOGIN");
|
// d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||||
d.password = Util.Uniquify("PASSWORD");
|
|
||||||
d.roles = 0;//norole
|
|
||||||
|
|
||||||
d.userType = 3;//non scheduleable
|
// ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
//Required by form custom rules
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
d.notes = "notes";
|
// FirstInOrdertId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
// d = new JObject();
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// d.name = Util.Uniquify(ObjectNameStart);
|
||||||
FirstInOrdertId = a.ObjectResponse["data"]["id"].Value<long>();
|
// d.login = Util.Uniquify("LOGIN");
|
||||||
|
// d.password = Util.Uniquify("PASSWORD");
|
||||||
|
// d.roles = 0;//norole
|
||||||
|
|
||||||
d = new JObject();
|
// d.userType = 3;//non scheduleable
|
||||||
d.name = Util.Uniquify(ObjectNameStart);
|
// d.active = true;
|
||||||
d.login = Util.Uniquify("LOGIN");
|
// //Required by form custom rules
|
||||||
d.password = Util.Uniquify("PASSWORD");
|
// d.notes = "notes";
|
||||||
d.roles = 0;//norole
|
// d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||||
|
|
||||||
d.userType = 3;//non scheduleable
|
// a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
d.active = true;
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
//Required by form custom rules
|
// ThirdInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
d.notes = "notes";
|
|
||||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
|
||||||
|
|
||||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
// d = new JObject();
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// d.name = Util.Uniquify(ObjectNameStart);
|
||||||
ThirdInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
// d.login = Util.Uniquify("LOGIN");
|
||||||
|
// d.password = Util.Uniquify("PASSWORD");
|
||||||
|
// d.roles = 0;//norole
|
||||||
|
|
||||||
d = new JObject();
|
// d.userType = 3;//non scheduleable
|
||||||
d.name = Util.Uniquify(ObjectNameStart);
|
// d.active = false;
|
||||||
d.login = Util.Uniquify("LOGIN");
|
// //Required by form custom rules
|
||||||
d.password = Util.Uniquify("PASSWORD");
|
// d.notes = "notes";
|
||||||
d.roles = 0;//norole
|
// d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||||
|
|
||||||
d.userType = 3;//non scheduleable
|
// a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
d.active = false;
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
//Required by form custom rules
|
// SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
d.notes = "notes";
|
|
||||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
|
||||||
|
|
||||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
|
||||||
SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
|
||||||
|
|
||||||
|
|
||||||
//CREATE FILTER
|
// //CREATE FILTER
|
||||||
|
|
||||||
//FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
// //FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
||||||
// dynamic dfilter = new JArray();
|
// // dynamic dfilter = new JArray();
|
||||||
// //name starts with filter to constrict to widgets that this test block created only
|
// // //name starts with filter to constrict to widgets that this test block created only
|
||||||
// dynamic DataFilterNameStart = new JObject();
|
// // dynamic DataFilterNameStart = new JObject();
|
||||||
// DataFilterNameStart.fld = "username";
|
// // DataFilterNameStart.fld = "username";
|
||||||
// DataFilterNameStart.op = Util.OpStartsWith;
|
// // DataFilterNameStart.op = Util.OpStartsWith;
|
||||||
// DataFilterNameStart.value = ObjectNameStart;
|
// // DataFilterNameStart.value = ObjectNameStart;
|
||||||
// dfilter.Add(DataFilterNameStart);
|
// // dfilter.Add(DataFilterNameStart);
|
||||||
|
|
||||||
// dynamic dsortarray = new JArray();
|
// // dynamic dsortarray = new JArray();
|
||||||
|
|
||||||
//SORT ORDER ###################
|
// //SORT ORDER ###################
|
||||||
//sort by active then by ID
|
// //sort by active then by ID
|
||||||
|
|
||||||
// dynamic dsort = new JObject();
|
// // dynamic dsort = new JObject();
|
||||||
// dsort.fld = "useractive";
|
// // dsort.fld = "useractive";
|
||||||
// dsort.dir = "+";
|
// // dsort.dir = "+";
|
||||||
// dsortarray.Add(dsort);
|
// // dsortarray.Add(dsort);
|
||||||
|
|
||||||
// dsort = new JObject();
|
// // dsort = new JObject();
|
||||||
// dsort.fld = "df";
|
// // dsort.fld = "df";
|
||||||
// dsort.dir = "+";
|
// // dsort.dir = "+";
|
||||||
// dsortarray.Add(dsort);
|
// // dsortarray.Add(dsort);
|
||||||
|
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
//name starts with filter to constrict to widgets that this test block created only
|
// //name starts with filter to constrict to widgets that this test block created only
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("username", Util.OpStartsWith, ObjectNameStart));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("username", Util.OpStartsWith, ObjectNameStart));
|
||||||
dListView.Add(Util.BuildSimpleSortDataListViewColumn("useractive", "+"));
|
// dListView.Add(Util.BuildSimpleSortDataListViewColumn("useractive", "+"));
|
||||||
//DEPRECATED NO DF ANYMORE dListView.Add(Util.BuildSimpleSortDataListViewColumn("df", "+"));
|
// //DEPRECATED NO DF ANYMORE dListView.Add(Util.BuildSimpleSortDataListViewColumn("df", "+"));
|
||||||
|
|
||||||
//NOW FETCH WIDGET LIST WITH FILTER UserDataList
|
// //NOW FETCH WIDGET LIST WITH FILTER UserDataList
|
||||||
// a = await Util.GetAsync($"DataList/list?DataListKey=UserDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
// // a = await Util.GetAsync($"DataList/list?DataListKey=UserDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView, 999, 0, "TestUserDataList"));
|
// a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView, 999, 0, "TestUserDataList"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//assert contains exactly 3 records
|
// //assert contains exactly 3 records
|
||||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
// ((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||||
|
|
||||||
//assert the order returned
|
// //assert the order returned
|
||||||
a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrdertId);
|
// a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrdertId);
|
||||||
a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderId);
|
// a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderId);
|
||||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderId);
|
// a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderId);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.DeleteAsync("User/" + FirstInOrdertId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
// a = await Util.DeleteAsync("User/" + FirstInOrdertId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("User/" + SecondInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
// a = await Util.DeleteAsync("User/" + SecondInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("User/" + ThirdInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
// a = await Util.DeleteAsync("User/" + ThirdInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//==================================================
|
//==================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user