public void AddTest() { CompanyGroup.Domain.WebshopModule.IProductRepository productRepository = new CompanyGroup.Data.WebshopModule.ProductRepository(); ShoppingCartRepository shoppingCartRepository = new ShoppingCartRepository(); ShoppingCart shoppingCart = new ShoppingCart(1, "alma", "teszt rt", "test2 person", "cart55", "HUF", false); ShoppingCartItem shoppingCartItem = new ShoppingCartItem(); Product product = productRepository.GetItem(0, "JD990A", "hrp"); shoppingCartItem.SetProduct(product); int cartId = shoppingCartRepository.Add(shoppingCart); shoppingCartItem.CartId = cartId; shoppingCartRepository.AddLine(shoppingCartItem); Assert.IsTrue(cartId > 0, "ShoppingCart cannot be empty!"); }
public void AddItemTest() { CompanyGroup.Domain.WebshopModule.IProductRepository productRepository = new CompanyGroup.Data.WebshopModule.ProductRepository(); ShoppingCartRepository shoppingCartRepository = new ShoppingCartRepository(); Product product = productRepository.GetItem(0, "AMVS238H", "hrp"); ShoppingCartItem shoppingCartItem = new ShoppingCartItem(); shoppingCartItem.SetProduct(product); shoppingCartItem.CartId = 1; shoppingCartRepository.AddLine(shoppingCartItem); }