public CategoryControllerTests() { _categoryAdminService = A.Fake <ICategoryAdminService>(); //use the default of the container existing A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(true); _categoryController = new CategoryController(_categoryAdminService); }
public CategoryControllerTests() { _categoryAdminService = A.Fake<ICategoryAdminService>(); //use the default of the container existing A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(true); _categoryController = new CategoryController(_categoryAdminService); }
public void CategoryController_Index_ModelIsNullIfTheCategoryContainerDoesNotExist() { A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(false); ViewResult index = _categoryController.Index("test", 1); index.Model.Should().BeNull(); }
public ViewResult Index(string q = null, int p = 1) { if (!_categoryAdminService.ProductContainerExists()) { return(View()); } IPagedList <Category> categoryPagedList = _categoryAdminService.Search(q, p); return(View(categoryPagedList)); }