Beispiel #1
0
        public void AddProductFirstTime()
        {
            double amount = 0;

            mainDBHelper.InitializeNewBillEntry("Suresh", true);
            bool isAdded = mainDBHelper.AddProduct("Selfie", out amount);

            Assert.IsTrue(isAdded, "Product not added to Bill entry, when it exists in database.");
            Assert.AreEqual(50, amount, "Amount for the product not equal to the expected value.");
            Assert.AreEqual("50", mainDBHelper.GetTotalAmount(), "Amount for the product not equal to the expected value.");
        }
Beispiel #2
0
        public void SaveCurrentEntry()
        {
            if (dbHelper.GetCustomerName() == "" || dbHelper.GetPhoneNumber() == "" || dbHelper.GetTotalAmount() == "0")
            {
                dialogHelper.ShowWarning("Customer Name or Phone Number or Product details missing", "Required!!!");
            }
            else if (dbHelper.GetBillType() == BillType.Undefined)
            {
                dialogHelper.ShowWarning("Select Bill Type", "Alert!!!");
            }
            else
            {
                bool isSaved = dbHelper.SaveEntryToDatabase();

                if (isSaved)
                {
                    dialogHelper.ShowInfo("Details Saved", "Success");
                }
                else
                {
                    dialogHelper.ShowInfo("Already Saved", "Info");
                }
            }
        }