public void SaveEnrolleeTest() { var newDude = new PrimaryEnrollee("1234") { MailingAddr = "805 N Guest", BillingAddr = "805 N Guest", Email = "*****@*****.**", FirstName = "Guest", LastName = "Guest", HomePhone = "1234567890", MobilePhone = "1234567890", SSN = "123456788" }; var myId = mgr.SaveEnrollee(newDude); PrimaryEnrollee saved = null; if (myId != null) { saved = mgr.FindPrimaryById(myId.Value); } Assert.IsNotNull(myId); Assert.IsNotNull(saved); Assert.AreEqual(myId.Value, saved.Id); Assert.AreEqual(newDude, saved); }
public void SaveBillTest() { HSP hsp = new HSP("1234", true) { Name = "zach", ServicesOffered = new List <string>() { "Inpatient" }, Address = "Address", BankName = "Name", Personnel = "Contact", RoutingNum = 123456, AccountNum = 123456 }; mgr.SaveHsp(hsp); var newDude = new PrimaryEnrollee("1234") { MailingAddr = "805 N Guest", BillingAddr = "805 N Guest", Email = "*****@*****.**", FirstName = "Guest", LastName = "Guest", HomePhone = "1234567890", MobilePhone = "1234567890", SSN = "123456788" }; var services = mgr.GetServicesByPlan("Basic"); var plan = mgr.GetPlanByType("Basic"); var ePlan = new EnrolleePlan(newDude, plan); var myId = mgr.SaveEnrollee(newDude); ePlan.PrimaryEnrollee = newDude.Id; var planNum = (int)mgr.SaveEnrolleePlan(ePlan); var bill = new Bill( DateTime.Now, hsp.Id, planNum, services.ElementAt(0).Id, newDude.Id, newDude.Email, 1000, 500 ); bill.IsPrimary = true; mgr.addBill(bill); Bill dbBill = null; dbBill = mgr.GetBillsById(newDude.Id).ElementAt(0); Assert.IsNotNull(dbBill); Assert.AreEqual(dbBill.Id, bill.Id); Assert.AreEqual(dbBill.enrolleeEmail, bill.enrolleeEmail); }
public void CreatePrimaryEnrolleeTest() { // arrange var ctrl = new EnrollController(); var first = "Michael"; var last = "Rhodes"; var email = "*****@*****.**"; var billing = "804 n ealy"; var hyphenPhone = "1214-291-3214"; var home = "2142913214"; var ssn = "222101923"; var hyphenSsn = "222-10-1923"; var pin = "9253"; string mailing = ""; string mobile = ""; var testEnrollee = new PrimaryEnrollee(pin) { BillingAddr = billing, Email = email, FirstName = first, LastName = last, HomePhone = home, MailingAddr = mailing, SSN = ssn, MobilePhone = mobile }; var ctrlContact = new EnrollController.Contact { email = email, homePhone = hyphenPhone, mobilePhone = mobile }; // act ctrl.CreatePrimaryEnrollee( first, last, hyphenSsn, mailing, billing, pin, ctrlContact ); //assert Assert.IsNotNull(ctrl.PrimaryEnrollee); Assert.AreEqual(ctrl.PrimaryEnrollee, testEnrollee); }
public void LoginTest() { var primary = new PrimaryEnrollee("2103") { MailingAddr = "805 N Ealy", Email = "*****@*****.**", FirstName = "Michael", LastName = "Rhodes", HomePhone = "2178214819", SSN = "555102104" }; var isLogged = primary.Login("*****@*****.**", "2103"); Assert.IsTrue(isLogged); }
public void CheckPolicyTest() { DbMgr Mgr; Mgr = DbMgr.Instance; InsurancePlan p = new InsurancePlan(); PrimaryEnrollee e = new PrimaryEnrollee("0"); EnrolleePlan eP = new EnrolleePlan(e, p); Mgr.SaveEnrolleePlan(eP); var bill = new BillController(); bool notTrue = bill.CheckPolicy(2); bool soTrue = bill.CheckPolicy(1); Assert.IsFalse(notTrue); Assert.IsTrue(soTrue); }
public void CheckEnrolleeTest() { DbMgr Mgr; Mgr = DbMgr.Instance; PrimaryEnrollee e = new PrimaryEnrollee("0"); e.FirstName = "A"; e.LastName = "B"; e.SSN = "123456778"; Mgr.SaveEnrollee(e); var bill = new BillController(); bool notTrue = bill.CheckEnrollee("A"); bool soTrue = bill.CheckEnrollee("A B"); Assert.IsFalse(notTrue); Assert.IsTrue(soTrue); }
public void PickPlanTest() { var ctrl = new EnrollController(); var mgr = DbMgr.Instance; var primary = new PrimaryEnrollee("2103") { MailingAddr = "805 N Ealy", Email = "*****@*****.**", FirstName = "Michael", LastName = "Rhodes", HomePhone = "2178214819", SSN = "555102104" }; //var plan = mgr.Plans.ElementAt(0); ctrl.PrimaryEnrollee = primary; //var enrolleePlan = ctrl.PickPlan($"{plan.Type}"); //var dupEnrolleePlan = ctrl.PickPlan($"{plan.Type}"); //Assert.AreEqual(enrolleePlan, dupEnrolleePlan); }
public void HSPCalculateTest() { DbMgr Mgr; Mgr = DbMgr.Instance; InsurancePlan p = new InsurancePlan(); p.Type = "Basic"; PrimaryEnrollee e = new PrimaryEnrollee("0"); EnrolleePlan eP = new EnrolleePlan(e, p); Mgr.SaveEnrolleePlan(eP); var bill = new BillController(); List <String> s = new List <String>(); s.Add("Inpatient"); s.Add("Inpatient"); List <int> c = new List <int>(); c.Add(2500); c.Add(1500); bill.CheckEnrollee("A B"); bill.CheckPolicy(1); String[,] returnArr = new String[2, 4]; returnArr = bill.HSPCalculate(s, c, DateTime.Now); Assert.AreEqual("2000", returnArr[0, 1]); Assert.AreEqual("560", returnArr[0, 2]); Assert.AreEqual("1440", returnArr[0, 3]); Assert.AreEqual("1500", returnArr[1, 1]); Assert.AreEqual("510", returnArr[1, 2]); Assert.AreEqual("990", returnArr[1, 3]); }