Пример #1
0
        private void VerifyCorrectListData(List <int> results)
        {
            List <int> records = new List <int>(results);

            records.Sort();
            List <long> expectedRecords = SortProcessHelper.GetSortedIdList(records, string.Empty, string.Empty);

            PrAssert.That(results, Is.EqualTo(expectedRecords), "The sort is incorrect.");
        }
        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");
        }