public void Can_Get_Paged(int instanceCount, int page, int count, int expected)
        {
            Scaffold.Instances(instanceCount);

            List <WorkflowInstanceViewModel> instances = _service.Get(page, count);

            Assert.Equal(expected, instances.Count);
        }
示例#2
0
        public IHttpActionResult GetAllInstances(int count, int page)
        {
            try
            {
                List <WorkflowInstance> workflowInstances = _instancesService.Get(page, count, null);

                return(Json(new
                {
                    items = workflowInstances,
                    total = _instancesService.CountPending(),
                    page,
                    count
                }, ViewHelpers.CamelCase));
            }
            catch (Exception e)
            {
                const string error = "Error getting workflow instances";
                Log.Error(error, e);
                return(Content(HttpStatusCode.InternalServerError, ViewHelpers.ApiException(e, error)));
            }
        }