public void Can_Count_All(int count)
        {
            Scaffold.Instances(count);
            double result = _service.CountAll();

            Assert.Equal(count, result);
        }
Beispiel #2
0
        public IHttpActionResult GetAllInstances(int count, int page)
        {
            try
            {
                List <WorkflowInstance> workflowInstances = _instancesService.Get(page, count);

                return(Json(new
                {
                    items = workflowInstances,
                    totalPages = (int)Math.Ceiling(_instancesService.CountAll() / count),
                    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)));
            }
        }