public void Can_Count_Pending(int pendingCount, int approvedCount) { Scaffold.Instances(pendingCount); Scaffold.Instances(approvedCount, status: (int)WorkflowStatus.Approved); int result = _service.CountPending(); Assert.Equal(pendingCount, result); }
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))); } }