Beispiel #1
0
        public void GetAvailableProducts_returns_list_of_products()
        {
            // arrange
            _repository.Setup(repo => repo.GetProductList())
            .Returns(new List <Product>
            {
                new Product {
                    Id = "123", Name = "Sweater", Description = "Agora Wool Sweater", Price = 64.95m
                },
                new Product {
                    Id = "234", Name = "Blue Jeans", Description = "Fancy new jeans", Price = 45.99m
                }
            });

            // act
            var products = _productService.GetAvailableProducts();

            // assert
            Assert.AreEqual(2, products.Count());
        }
 public IEnumerable <Product> GetProducts()
 {
     return(_productInventoryService.GetAvailableProducts());
 }