public void Indicates_Selected_Category()
        {
            // Arrange - create ProductRepository Mock
            Mock<IProductRepository> mockedProductRepository = new Mock<IProductRepository>();
            mockedProductRepository.Setup(m => m.Products).Returns(new[]
                {
                    new Product{ProductID = 1, Name = "P1", Category = "C1"},
                    new Product{ProductID = 2, Name = "P2", Category = "C2"}
                }.AsQueryable());

            // Arrange - Create controller
            NavController navController = new NavController(mockedProductRepository.Object);

            // Act - Calls Controller's Menu action
            const string selectedCategory = "C2";
            string actualSelectedCategory = navController.Menu(selectedCategory).ViewBag.SelectedCategory;

            // Assert
            Assert.AreEqual(selectedCategory, actualSelectedCategory);
        }
        public void Can_Create_Categories()
        {
            // Arrange - create mocked Product repository
            Mock<IProductRepository> mockedProductRepository = new Mock<IProductRepository>();
            mockedProductRepository.Setup(m => m.FindAllProductCategories()).Returns(new[] { "C1", "C2", "C3" }.AsQueryable());

            // Arrange - Create the controller
            NavController navController = new NavController(mockedProductRepository.Object);

            // Act - get the set of categories
            IEnumerable<string> products = navController.Menu().Model as IEnumerable<string>;

            // Assert
            Assert.IsNotNull(products);
            CollectionAssert.AreEqual(new[] { "C1", "C2", "C3" }, products.ToArray());
        }