Exemplo n.º 1
0
        public void TestAllProduct()
        {
            var service = new ProductService()
                {
                    ProductRepository = new FakeProductRepository()
                };

            var result = service.AllProducts();

            Assert.AreEqual(3, result.Count());
        }
Exemplo n.º 2
0
        public void TestAllProductButEmpty()
        {
            var service = new ProductService()
            {
                ProductRepository = new EmptyFakeProductRepository()
            };

            var result = service.AllProducts();

            Assert.NotNull(result);
            Assert.AreEqual(0, result.Count());
        }
Exemplo n.º 3
0
 //
 // GET: /Home/
 public ActionResult Index()
 {
     var service = new ProductService();
     return View(service.AllProducts());
 }