public OrderService(IproductInventory productrepo) { _email = new EmailingSystem(); _invetoryrepo = new ProductInventory(new ProductRepo()); _carddetails = new VerifyCardDetails(); }
public void Initialize() { _mockProductRepository = new Mock <IProductRepo>(); _inventoryService = new ProductInventory(_mockProductRepository.Object); _orderService = new OrderService(); _paymentService = new VerifyCardDetails(); var products = new List <Product> { new Product { ProductId = 1, Price = 22.6m, ProductName = "Test Product 1", Quantity = 12 }, new Product { ProductId = 2, Price = 43.6m, ProductName = "Test Product 2", Quantity = 7 }, new Product { ProductId = 3, Price = 67.6m, ProductName = "Test Product 3", Quantity = 1 }, new Product { ProductId = 4, Price = 49.8m, ProductName = "Test Product 4", Quantity = 3 }, new Product { ProductId = 5, Price = 18.2m, ProductName = "Test Product 5", Quantity = 9 }, new Product { ProductId = 6, Price = 11.1m, ProductName = "Test Product 6", Quantity = 13 }, new Product { ProductId = 7, Price = 33.6m, ProductName = "Test Product 7", Quantity = 22 }, new Product { ProductId = 8, Price = 88.6m, ProductName = "Test Product 8", Quantity = 0 }, new Product { ProductId = 9, Price = 22.2m, ProductName = "Test Product 9", Quantity = 19 } }; _mockProductRepository.Setup(mock => mock.TotalListOfProducts()).Returns(products); }