public void category_producer_details_httppost_modelstate_invalid()
        {
            //Arrange
            TestControllerBuilder builder = new TestControllerBuilder();
            var controller = new CategoryController(new CategoryBLL(new CategoryDALStub()));
            builder.InitializeController(controller);
            builder.HttpContext.Session["loggedInUser"] = new Customer() { id = 1, admin = true };
            controller.ViewData.ModelState.AddModelError("error", "noe gikk galt");
            ProducerInfo pi = new ProducerInfo()
            {
                prodId = 12,
                prodName = "En produsent"
            };

            //Act
            var action = (JsonResult)controller.ProducerDetails(pi.prodId, pi);
            var result = (bool)(new PrivateObject(action.Data, "success")).Target;

            //Assert
            Assert.IsFalse(result); 
        }
        public void category_producer_details_view()
        {
            //Arrange
            TestControllerBuilder builder = new TestControllerBuilder();
            var controller = new CategoryController(new CategoryBLL(new CategoryDALStub()));
            builder.InitializeController(controller);
            builder.HttpContext.Session["loggedInUser"] = new Customer() { id = 1, admin = true };

            //Act
            var action = (ViewResult)controller.ProducerDetails(5);
            var result = (ProducerInfo)action.Model;

            //Assert
            Assert.AreEqual("", action.ViewName);
            Assert.IsNotNull(result);
            Assert.AreEqual(5, result.prodId);
        }