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."); }
public void Initialize(string userName, bool isAdmin) { view.SetFocusToName(); view.SetSessionUserName(userName); currentSessionUser = userName; view.SetDate(string.Concat("Date :", " ", string.Format(DateTime.Now.ToString(), "dd/MM/yyyy"))); dbHelper.InitializeNewBillEntry(userName, true); string number = dbHelper.GetBillID(); view.UpdateInvoiceID(string.Concat("Invoice : ", string.Format(number, "0000"))); if (isAdmin) { view.ShowAdminOptions(); } else { view.HideAdminOptions(); } view.GreyoutDiscount(); }