public void GetCategoriesByType_ThrowsWebuiHelperException() { _categoryService.Setup(m => m.GetList(It.IsAny <Expression <Func <Category, bool> > >())).Throws <ServiceException>(); var target = new ReportControllerHelper(_categoryService.Object, null, null); target.GetCategoriesByType(new WebUser(), 1); }
public void GetCategoriesByType_ThrowsWebUiHelperExceptionWithInnerServiceException() { _categoryService.Setup(m => m.GetList()).Throws <ServiceException>(); var target = new ReportControllerHelper(_categoryService.Object, null, null); try { target.GetCategoriesByType(new WebUser(), 1); } catch (WebUiHelperException e) { Assert.IsInstanceOfType(e.InnerException, typeof(ServiceException)); } }