public FulltimeEmployee(FulltimeEmployee prev) : base(prev) { dateOfHire = prev.GetDateOfHire(); dateOfTermination = prev.GetDateOfTermination(); salary = prev.GetSalary(); SetType("FT"); }
public void SetDateOfHireDateTestInvalidDOHbeforeDOB() { DateTime DOB = new DateTime(1985, 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.SetDateOfHire("1980-12-24"); Assert.IsFalse(retVal); int compReturn = DateTime.Compare(employee.GetDateOfHire(), DOH); Assert.AreEqual(0, compReturn); }
public void SetDateOfHireStringTestValidString() { FulltimeEmployee employee = new FulltimeEmployee(); bool retVal = employee.SetDateOfHire("1993-04-24"); Assert.IsTrue(retVal); DateTime date = new DateTime(1993, 04, 24); int compReturn = DateTime.Compare(employee.GetDateOfHire(), date); Assert.AreEqual(0, compReturn); }
public void SetDateOfHireStringTestInvalidFormat() { FulltimeEmployee employee = new FulltimeEmployee(); bool retVal = employee.SetDateOfHire("19930424"); Assert.IsFalse(retVal); DateTime date = new DateTime(); int compReturn = DateTime.Compare(employee.GetDateOfHire(), date); Assert.AreEqual(0, compReturn); }
public void SetDateOfHireIntsTestInvalidDate() { FulltimeEmployee employee = new FulltimeEmployee(); bool retVal = employee.SetDateOfHire(1993, 04, 31); Assert.IsFalse(retVal); DateTime date = new DateTime(); int compReturn = DateTime.Compare(employee.GetDateOfHire(), date); Assert.AreEqual(0, compReturn); }
public void SetDateOfHireDateTestValidDate() { FulltimeEmployee employee = new FulltimeEmployee(); DateTime date = new DateTime(2012, 04, 23); bool retVal = employee.SetDateOfHire(date); Assert.IsTrue(retVal); int compReturn = DateTime.Compare(employee.GetDateOfHire(), date); Assert.AreEqual(0, compReturn); }