public void ResetCart() { XsollaStore.Instance.CreateNewCart(XsollaSettings.StoreProjectId, newCart => { Cart = newCart; CartModel.Clear(); var cartGroup = FindObjectOfType <CartGroupUI>(); cartGroup.ResetCounter(); _itemsController.RefreshActiveContainer(); }, ShowError); }
public void Can_Clear_Cart() { // Arrange Product p1 = new Product { ProductId = 1, Name = "P1", Price = 100m }; Product p2 = new Product { ProductId = 2, Name = "P2", Price = 50m }; CartModel cart = new CartModel(); cart.AddItem(p1, 1); cart.AddItem(p2, 1); cart.AddItem(p1, 10); // Act cart.Clear(); // Assert Assert.Empty(cart.Lines); }