public void GetEditProductPriceTest()
 {
     _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板");
     _ShopListPresentationModel.AddItemToCart();
     _productManagement.EditProductPrice(_productManagement.AllProducts[0], "999");
     Assert.AreEqual(_ShopListPresentationModel.GetEditProductPrice(), "999");
 }
Beispiel #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);
        }