Beispiel #1
0
        public void TemplateService_AllTemplateDomains_CallsRepositoryQuery()
        {
            #region Arrange

            #endregion

            #region Act

            _templateService.AllTemplateDomains("SORT");

            #endregion

            #region Assert

            _mockTemplateDomainRepository.Verify(x => x.Query(It.IsAny <Expression <Func <TemplateDomain, bool> > >()), Times.Once);

            #endregion
        }
Beispiel #2
0
        public ActionResult ReadAjaxTemplateDomainGrid([DataSourceRequest] DataSourceRequest request, string templateType)
        {
            DataSourceResult result = null;

            try
            {
                result = _templateService.AllTemplateDomains(templateType)
                         .ToDataSourceResult(request, Mapper.Map <TemplateDomainListItem, TemplateDomainViewModel>);
            }
            catch (Exception ex)
            {
                _contextManager.ResponseManager.StatusCode = 500;
                _contextManager.ResponseManager.AppendHeader("ErrorMessage", ex.Message);
            }

            var jsonResult = Json(result);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }