Пример #1
0
        public void UpdateAdvanceMoreThanAmount()
        {
            AddMultipleProducts();
            double balance   = 0;
            bool   isUpdated = mainDBHelper.UpdateAdvance(200, out balance);

            Assert.IsFalse(isUpdated, "Updation should not happen when the advance is greater than total");
            Assert.AreEqual("0", mainDBHelper.GetAdvance(), "Internal values messed up.");
            Assert.AreEqual("190", mainDBHelper.GetBalance(), "Internal values messed up.");
            Assert.AreEqual("0", mainDBHelper.GetDiscount(), "Internal values messed up.");
        }
Пример #2
0
        public void UpdateAdvance(double advance)
        {
            double balance         = 0;
            bool   isUpdateSuccess = dbHelper.UpdateAdvance(advance, out balance);

            if (isUpdateSuccess)
            {
                view.UpdateBalance(balance.ToString());
                view.SetDiscountAsAvailable();
            }
            else
            {
                view.UpdateAdvance("");
                dialogHelper.ShowError("Pay exceeds total amount", "Data Entry Error!!!");
            }
        }