예제 #1
0
        public void InitializeNewEntryForceCreate()
        {
            bool isInitialized = mainDBHelper.InitializeNewBillEntry("Suresh", true);

            Assert.IsTrue(isInitialized, "Internal Status of current Bill Entry not initialized");
            Assert.AreEqual(string.Empty, mainDBHelper.GetCustomerName(), "Internal customerName of current Bill Entry not initialized");
            Assert.AreEqual(string.Empty, mainDBHelper.GetPhoneNumber(), "Internal PhoneNumber of current Bill Entry not initialized");
            Assert.AreEqual("50000", mainDBHelper.GetBillID(), "Initialize value not read from file correctly.");
            Assert.AreEqual(BillType.Undefined, mainDBHelper.GetBillType(), "Internal Bill Type not in the right state.");
        }
예제 #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");
                }
            }
        }