public void GetEditProductCategoryTest() { _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板"); _ShopListPresentationModel.AddItemToCart(); _productManagement.EditProductCategory(_productManagement.AllProducts[0], "cagegory"); Assert.AreEqual(_ShopListPresentationModel.GetEditProductCategory(), "cagegory"); }
// 修改購物車裡面的商品 private void UpdateCart() { int rowIndex = this.GetChangedProductRowIndex(); _orderDataGridView.Rows[rowIndex].Cells[NAME_COLUMN_INDEX].Value = _shopListPresentationModel.GetEditProductName(); _orderDataGridView.Rows[rowIndex].Cells[CATEGORY_COLUMN_INDEX].Value = _shopListPresentationModel.GetEditProductCategory(); _orderDataGridView.Rows[rowIndex].Cells[PRICE_COLUMN_INDEX].Value = _shopListPresentationModel.GetEditProductPrice(); _orderDataGridView.Rows[rowIndex].Cells[SUBTOTAL_COLUMN_INDEX].Value = _shopListPresentationModel.GetSubtotal(int.Parse(_orderDataGridView.Rows[rowIndex].Cells[NUMBER_COLUMN_INDEX].Value.ToString()), rowIndex).ToString(FORMAT); _totalPriceLabel.Text = this.GetTotalPrice().ToString(FORMAT); }