public FulltimeEmployee(FulltimeEmployee prev) : base(prev) { dateOfHire = prev.GetDateOfHire(); dateOfTermination = prev.GetDateOfTermination(); salary = prev.GetSalary(); SetType("FT"); }
public void SetDateOfTerminationStringTestValidString() { DateTime DOB = new DateTime(1954, 08, 20); DateTime DOH = new DateTime(1994, 09, 03); DateTime DOT = new DateTime(2000, 03, 23); FulltimeEmployee employee = new FulltimeEmployee("Brandon", "Davies", 123456789, DOB, DOH, DOT, 230000); bool retVal = employee.SetDateOfTermination("1997-04-24"); Assert.IsTrue(retVal); DateTime date = new DateTime(1997, 04, 24); int compReturn = DateTime.Compare(employee.GetDateOfTermination(), date); Assert.AreEqual(0, compReturn); }
public void SetDateOfTerminationStringTestInvalidDOTbeforeDOH() { DateTime DOB = new DateTime(1954, 08, 20); DateTime DOH = new DateTime(1994, 09, 03); DateTime DOT = new DateTime(2000, 03, 23); FulltimeEmployee employee = new FulltimeEmployee("Brandon", "Davies", 123456789, DOB, DOH, DOT, 230000); bool retVal = employee.SetDateOfTermination("1993-12-24"); Assert.IsFalse(retVal); int compReturn = DateTime.Compare(employee.GetDateOfTermination(), DOT); Assert.AreEqual(0, compReturn); }