public void ProcessSublistSearchHappyPathTest(string field, string conditionField, ProcessSublistSearchCases.SuffixOperator suffix, string orderField, ProcessSublistSearchCases.OrderType order, int count) { var resource = conditionField == SortProcessHelper.ProcessClient ? ResourceId.Client : ResourceId.Job; var index = (suffix == ProcessSublistSearchCases.SuffixOperator.Gt || suffix == ProcessSublistSearchCases.SuffixOperator.Ge) ? FirstRef : SecondeRef; var request = ProcessSublistSearchCases.GetSublistSearchForProcess(field, conditionField, suffix, orderField, order, count, RefRecordsCreator.Data[$"{resource}{index}"].Id); var handler = new DefaultManager(); var response = handler.SendAsync <List <int> >(ProcessSublistTestData.ProcessSublistEndPoint, request.ToJson(), HttpMethod.POST).Result; PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Can not search sublist of Process"); var sortedList = SortProcessHelper.GetSortedIdList(response.Result, orderField, order.ToString().ToLower()); PrAssert.That(response.Result, PrIs.EqualTo(sortedList), "Not as expected order"); }
public void ProcessSublistSearchValidApplicationFieldTest(string field, string conditionField, ProcessSublistSearchCases.SuffixOperator suffix, string orderField, ProcessSublistSearchCases.OrderType order, int count) { SendRequestAndVerifyResponse(field, conditionField, suffix, orderField, order, count); }
public static Dictionary <string, object> GetSublistSearchForProcess(string field, string conditionField, ProcessSublistSearchCases.SuffixOperator suffix, string orderField, OrderType order, int count, ulong recordId) { var request = new Dictionary <string, object> { ["resource"] = "Process", ["fields"] = field, ["condition"] = $"{conditionField}:{suffix.ToString().ToLower()}={recordId}", ["order"] = $"{orderField}:{order.ToString().ToLower()}", ["count"] = count }; if (count == 0) { request.Remove("count"); } return(request); }
public void ProcessSublistSearchValidUserFieldTest(string field, string conditionField, ProcessSublistSearchCases.SuffixOperator suffix, HRBCClientPrivate.API.Field.FieldType orderField, ProcessSublistSearchCases.OrderType order, int count) { SendRequestAndVerifyResponse(field, conditionField, suffix, FieldCreator.Data[$"{orderField}"].Field.ToAlias(), order, count); }