Ejemplo n.º 1
0
 public CategoryControllerTests()
 {
     _categoryAdminService = A.Fake <ICategoryAdminService>();
     //use the default of the container existing
     A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(true);
     _categoryController = new CategoryController(_categoryAdminService);
 }
Ejemplo n.º 2
0
 public CategoryControllerTests()
 {
     _categoryAdminService = A.Fake<ICategoryAdminService>();
     //use the default of the container existing
     A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(true);
     _categoryController = new CategoryController(_categoryAdminService);
 }
Ejemplo n.º 3
0
        public void CategoryController_Index_ModelIsNullIfTheCategoryContainerDoesNotExist()
        {
            A.CallTo(() => _categoryAdminService.ProductContainerExists()).Returns(false);

            ViewResult index = _categoryController.Index("test", 1);

            index.Model.Should().BeNull();
        }
Ejemplo n.º 4
0
        public ViewResult Index(string q = null, int p = 1)
        {
            if (!_categoryAdminService.ProductContainerExists())
            {
                return(View());
            }
            IPagedList <Category> categoryPagedList = _categoryAdminService.Search(q, p);

            return(View(categoryPagedList));
        }