public void IsAlreadyInCartTest()
 {
     _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板");
     _ShopListPresentationModel.AddItemToCart();
     Assert.IsFalse(_ShopListPresentationModel.IsAlreadyInCart());
     _ShopListPresentationModel.GetCurrentProduce("1", 1, "主機板");
     Assert.IsTrue(_ShopListPresentationModel.IsAlreadyInCart());
 }
Exemple #2
0
 // 選取商品後更新視窗
 private void UpdateItemClick(Button button)
 {
     _shopListPresentationModel.GetCurrentProduce(_itemTabControlPages.GetCurrentPage(), (int)(button.Tag), _itemTabControl.SelectedTab.Text); // 取得目前商品id
     _descriptionRichTextBox.Text = _shopListPresentationModel.GetDetail();                                                                    // 顯示商品詳細資料
     _stockLabel.Text             = _shopListPresentationModel.GetQuantity();                                                                  // 顯示庫存
     _priceLabel.Text             = _shopListPresentationModel.GetPrice();                                                                     // 顯示價錢
     _addToCartButton.Enabled     = _shopListPresentationModel.IsAlreadyInCart();                                                              // 如已加入購物車 就不可再次加入
 }