Example #1
0
 // 按下加入購物車後更新視窗
 private void UpdateAddToCart()
 {
     _shopListPresentationModel.AddItemToCart();                              // 加入購物車
     _addToCartButton.Enabled = false;
     _orderDataGridView.Rows.Add(_shopListPresentationModel.GetCartItem());   // 顯示物品到右邊表格
     _orderButton.Enabled  = _shopListPresentationModel.CheckConfirmButton(); // 確認訂購按鈕可以按下
     _totalPriceLabel.Text = this.GetTotalPrice().ToString(FORMAT);           // 顯示總價錢
 }
 public void IsEditItemInCartTest()
 {
     _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板");
     _ShopListPresentationModel.AddItemToCart();
     _productManagement.EditProductName(_productManagement.AllProducts[0], "name");
     Assert.IsTrue(_ShopListPresentationModel.IsEditItemInCart());
     _productManagement.EditProductName(_productManagement.AllProducts[1], "name");
     Assert.IsFalse(_ShopListPresentationModel.IsEditItemInCart());
 }