private void makePurchase_Click(object sender, EventArgs e) { profit.CalculateShareOfVendorStore(); storeProfitValue.Text = string.Format("${0}", profit.storeProfit); profit.shoppingCartData.Clear(); itemsBinding.DataSource = newItems.GetItemsNotSoldYet(); itemsBinding.DataSource = dataSource.GetItemsNotSoldYet(); cartBinding.ResetBindings(false); itemsBinding.ResetBindings(false); vendorsBinding.ResetBindings(false); }
public void ClearedShoppingCartTest() { // Arrange Profits profits = new Profits(); Store store = new Store(); store.Vendors.Add(new Vendor { FirstName = "Bill", LastName = "Smith" }); store.Items.Add(new Item { Title = "Moby Dick", Description = "A book about a whale", Price = 4.50M, Owner = store.Vendors[0] }); profits.shoppingCartData.Add(new Item { Title = "Moby Dick", Description = "A book about a whale", Price = 4.50M, Owner = store.Vendors[0] }); //Act var cartItems = profits.CalculateShareOfVendorStore(); // Assert Assert.IsEmpty(cartItems); }