예제 #1
0
        public void requesting_a_page_should_populate_models_and_pagination_result()
        {
            var results = _solutionAssembler.Get(f => f.IsIn("objid", _solution1Dto.Objid, _solution2Dto.Objid), new PaginationRequest {
                PageSize = 1, CurrentPage = 1
            });

            results.Models.Count().ShouldEqual(1);
            results.Models.First().IdNumber.ShouldEqual(_solution1Dto.IDNumber);

            results.CurrentPage.ShouldEqual(1);
            results.PageSize.ShouldEqual(1);
            results.TotalRecordCount.ShouldEqual(2);
        }
예제 #2
0
        private void pollForOpenCases(object sender, ElapsedEventArgs elapsedEventArgs)
        {
            var from = _lastPolled;
            var to   = _systemTime.Now;

            //using a ModelMap to project cases created between the last poll and now
            var cases = _caseModelBuilder.Get(f => f.Between("creation_time", from, to));

            _logger.LogInfo("{0} cases were created in the last {1} seconds", cases.Length, to.Subtract(from).TotalSeconds);

            foreach (var kase in cases)
            {
                //the debug log will have more details
                _logger.LogDebug(kase.ToString());
            }

            _lastPolled = to;
        }