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); }
public void UpdateItemQuantityTest() { ShoppingCartRepository repository = new ShoppingCartRepository(); int quantity = 4; repository.UpdateLineQuantity(1, quantity); ShoppingCart shoppingCart = repository.GetShoppingCart(1); Assert.IsNotNull(shoppingCart); }
public void RemoveLineTest() { ShoppingCartRepository repository = new ShoppingCartRepository(); repository.RemoveLine(2); }
public void GetShoppingCartLineTest() { ShoppingCartRepository repository = new ShoppingCartRepository(); ShoppingCartItem shoppingCartItem = repository.GetShoppingCartLine(1); Assert.IsNotNull(shoppingCartItem); }
public void GetItemsByVisitorIdTest() { ShoppingCartRepository repository = new ShoppingCartRepository(); string visitorId = "alma"; List<ShoppingCart> carts = repository.GetCartCollection(visitorId); Assert.IsFalse(carts.Count == 0); }
public void GetShoppingCartTest() { ShoppingCartRepository repository = new ShoppingCartRepository(); ShoppingCart cart = repository.GetShoppingCart(20); Assert.IsNotNull(cart); }