public void ChangeMailMethodTest() { AddHourlyEmployee he = new AddHourlyEmployee(base.EmpId, base.Name, base.Address, base.HourlyRate); he.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(base.EmpId); cmt.Execute(); var e = PayrollDatabase.GetEmployee(base.EmpId); Assert.IsTrue(e.Method is MailMethod); }
public void ChangeMailMethod() { int empid = 15; AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bill", "Home", 313); t.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(empid, "*****@*****.**"); cmt.Execute(); Employee e = PayrollDatabase.GetEmployee_Static(empid); Assert.IsNotNull(e); Assert.AreEqual("Mail [email protected]", e.Method.ToString()); }
public void ChangeMailTransaction() { int empId = SetupCommissionedEmployee(); var cmt = new ChangeMailTransaction(empId, "Somewhere"); cmt.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.NotNull(e); PaymentMethod pm = e.Method; var mm = Assert.IsType <MailMethod>(pm); Assert.Equal("Somewhere", mm.Address); }
public void TestChangeMailTransaction() { int empId = 1; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Bob", "Home", 1000.00); t.Execute(); ChangeMailTransaction cht = new ChangeMailTransaction(empId, "address123"); cht.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.AreEqual("Bob", e.Name); PaymentMethod pm = e.Method; Assert.IsTrue(pm is MailMethod); }
public void TestChangeMailTransaction() { int empId = 3; AddCommissionEmployee t = new AddCommissionEmployee(empId, "Kubing", "Home", 2000.00, 3.1, database); t.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(empId, database); cmt.Execute(); Employee e = database.GetEmployee(empId); Assert.IsNotNull(e); PaymentMethod pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is MailMethod); }
public void ChangeMailMethod() { int empId = 8; AddSalariedEmployee t = new AddSalariedEmployee( empId, "Mike", "Home", 3500.00, database); t.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(empId, database); cmt.Execute(); Employee e = database.GetEmployee(empId); Assert.IsNotNull(e); PaymentMethod method = e.Method; Assert.IsNotNull(method); Assert.IsTrue(method is MailMethod); }
public void TestChangeHoldTransaction() { const int empId = 15; var t = new AddSalariedEmployee(empId, "Bill", "Home", 2500.00); t.Execute(); var cmt = new ChangeMailTransaction(empId, "Work"); cmt.Execute(); var cht = new ChangeHoldTransaction(empId); cht.Execute(); var e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); var pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is HoldMethod); }
public void TestChangeMailTransaction() { const int empId = 14; var t = new AddSalariedEmployee(empId, "Bill", "Home", 2500.00); t.Execute(); var cmt = new ChangeMailTransaction(empId, "Work"); cmt.Execute(); var e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); var pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is MailMethod); var mm = pm as MailMethod; Assert.AreEqual("Work", mm.Address); }
public void ExecuteTest() { int empId = 28; string mailAddress = "MisStreet"; AddEmployeeTransaction addSalEmp = new AddSalariedEmployee(empId, "kara", "samubola", 3000, database); addSalEmp.Execute(); ChangeMethodTranscation changeMailTrans = new ChangeMailTransaction(empId, mailAddress, database); changeMailTrans.Execute(); Employee emp = database.GetEmployee(empId); Assert.IsNotNull(emp); Assert.IsTrue(emp.Method is MailMethod); MailMethod mailMethod = emp.Method as MailMethod; Assert.IsNotNull(mailMethod); Assert.AreEqual(mailMethod.Address, mailAddress); }
public void TestChangeMailTransaction() { int empId = 2; AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25); t.Execute(); ChangeMailTransaction mt = new ChangeMailTransaction(empId, "email"); mt.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); PaymentMethod pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is MailMethod); MailMethod dm = pm as MailMethod; Assert.AreEqual("email", dm.Address); }
public void TestChangeHoldTransaction() { var empId = 1; var addTx = new AddSalariedEmployee(empId, "Lance", "Home", 2500); addTx.Execute(); var changeMailTx = new ChangeMailTransaction(empId, "Home"); changeMailTx.Execute(); var changeHoldTx = new ChangeHoldTransaction(empId); changeHoldTx.Execute(); var employee = Database.GetEmployee(empId); Assert.IsNotNull(employee, "employee not found in database"); var method = employee.GetMethod(); Assert.IsInstanceOfType(method, typeof(HoldMethod), "employee does not have correct payment method"); }
public void TestChangeMailTransaction() { int empId = 10; AddSalariedEmployee t = new AddSalariedEmployee(empId, "Lance", "Home", 1000.00); t.Execute(); ChangeMailTransaction cmt = new ChangeMailTransaction(empId); cmt.Execute(); Employee e = PayrollDatabase.GetEmployee(empId); Assert.IsNotNull(e); PaymentMethod pm = e.Method; Assert.IsNotNull(pm); Assert.IsTrue(pm is MailMethod); }