private static int getTotalItemsByCategoryName(ProductController controller, string categoryName) { var productListViewModel = controller.List(categoryName).Model as ProductListViewModel; return productListViewModel != null ? productListViewModel.PagingInfo.TotalItems : 0; }
private static IEnumerable<Product> getProductsList(ProductController productController, string category, int page) { ProductListViewModel productListViewModel = (productController.List(category, page).Model as ProductListViewModel); Assert.IsNotNull(productListViewModel); return productListViewModel.Products; }