public void TestCreateProductView()
 {
     var adminController = new AdminController(_manafacturerRepository, _productRepository, _reviewRepository, _submitterRepository);
     var result = adminController.CreateProduct(1) as ViewResult;
     if (result != null)
     {
         var createProductResult = (ProductViewModel)result.ViewData.Model;
         Assert.AreEqual(0, createProductResult.ProductId);
         Assert.IsNullOrEmpty(createProductResult.ProductCode);
         Assert.IsNullOrEmpty(createProductResult.ProductName);
         Assert.IsNullOrEmpty(createProductResult.Description);
         Assert.AreEqual(0, createProductResult.Price);
         Assert.AreEqual(0, createProductResult.AverageRating);
         Assert.AreEqual(0, createProductResult.TotalReviewRows);
         Assert.AreEqual("TestManafacturer 1", createProductResult.ManafacturerName);
         Assert.AreEqual("TestManafacturer 1", createProductResult.ManafacturerNames[0]);
         Assert.AreEqual("TestManafacturer 2", createProductResult.ManafacturerNames[1]);
         Assert.AreEqual("TestManafacturer 3", createProductResult.ManafacturerNames[2]);
         Assert.AreEqual("TestManafacturer 4", createProductResult.ManafacturerNames[3]);
         Assert.AreEqual("TestManafacturer 5", createProductResult.ManafacturerNames[4]);
     }
 }
 public void TestCreateProductSubmit()
 {
     var adminController = new AdminController(_manafacturerRepository, _productRepository, _reviewRepository, _submitterRepository);
     var result = (RedirectResult)adminController.CreateProduct(new ProductViewModel
     {
         ProductCode = "Test106",
         ProductName = "TestProduct106",
         Description = "Testing product 6",
         Price = 106,
         ManafacturerName = "TestManafacturer 1"
     });
     if (result != null)
     {
         Assert.AreEqual("/Admin/ViewManafacturer?id=1", result.Url);
     }
 }