コード例 #1
0
 public void ProductIndex02Test()
 {
     ProductController target = new ProductController(new TestCategoryRepository(),
         new TestProductRepository(), new TestOrderRepository());
     int categoryId = -1;
     RedirectToRouteResult actual;
     actual = target.ProductIndex(categoryId) as RedirectToRouteResult;
     Assert.AreEqual("Sorry", actual.RouteValues["action"]);
     Assert.AreEqual("Result", actual.RouteValues["controller"]);
 }
コード例 #2
0
 public void ProductIndex01Test()
 {
     ProductController target = new ProductController(new TestCategoryRepository(), new TestProductRepository(), new TestOrderRepository());
     int categoryId = 1;
     ViewResult actual;
     actual = target.ProductIndex(categoryId) as ViewResult;
     Assert.IsNotNull(actual.ViewData.Model);
 }