public void IsForbiddenExactlyAtEndTime() { var punchInTime = DateTime.Now; var endTime = punchInTime; var shift = new ShiftBuilder() .WithEmployeeId(DefaultEmployeeId) .WithEndTime(endTime).Build(); shift.CanPunchIn(DefaultEmployeeId, punchInTime).Should().BeFalse(); }
public void IsForbiddenBeforeShiftStart() { var shift = new ShiftBuilder() .WithEmployeeId(DefaultEmployeeId) .WithStartTime(DateTime.Now) .WithEndTime(DateTime.Now.AddHours(8)) .Build(); var punchInTime = DateTime.Now.AddHours(-1); shift.CanPunchIn(DefaultEmployeeId, punchInTime).Should().BeFalse(); }
public void IsAllowedExactlyAtShiftStart() { var punchInTime = DateTime.Now.AddHours(-4); var startTime = punchInTime; var shift = new ShiftBuilder() .WithEmployeeId(DefaultEmployeeId) .WithStartTime(startTime) .Build(); shift.CanPunchIn(DefaultEmployeeId, punchInTime).Should().BeTrue(); }
public void IsForbiddenForWrongEmployee() { var otherEmployee = DefaultEmployeeId + 1; var shift = new ShiftBuilder() .WithEmployeeId(otherEmployee) .WithStartTime(DateTime.Now) .WithEndTime(DateTime.Now.AddHours(8)) .Build(); var punchInTime = DateTime.Now; shift.CanPunchIn(DefaultEmployeeId, punchInTime).Should().BeFalse(); }