public void AddMultiCart(MultiCart multiCart) { if (forTests) { return; } multiCarts.Add(multiCart); SaveChanges(); }
public void SetUp() { DbCommerce.GetInstance().StartTests(); Workshop192.MarketManagment.System.GetInstance().OpenStore("store1"); Workshop192.MarketManagment.System.GetInstance().OpenStore("store2"); store1 = Workshop192.MarketManagment.System.GetInstance().GetStore("store1"); store2 = Workshop192.MarketManagment.System.GetInstance().GetStore("store2"); multiCart = new MultiCart(1); store1.AddProducts(new Product(1, "can", "tin", 5), 5); store1.AddProducts(new Product(2, "floor", "wood", 10), 10); store2.AddProducts(new Product(3, "nike", "shoes", 25), 5); }
public static bool CheckAvailable(int userID) { MultiCart carts = Workshop192.MarketManagment.System.GetInstance().GetMultiCart(Workshop192.UserManagment.AllRegisteredUsers.GetInstance().GetUser(userID).GetMultiCart()); return(Workshop192.MarketManagment.System.GetInstance().CheckProductsAvailability(carts)); }