public void GetEditProductNameTest()
 {
     _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板");
     _ShopListPresentationModel.AddItemToCart();
     _productManagement.EditProductName(_productManagement.AllProducts[0], "name");
     Assert.AreEqual(_ShopListPresentationModel.GetEditProductName(), "name");
 }
Esempio n. 2
0
        // 修改購物車裡面的商品
        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);
        }