public void OneWeekCaseIsApproved() { EmployeeCase theCase = LogicAndDataAccess.CreateCase(1, new DateTime(2017, 1, 2), new DateTime(2017, 1, 6)); Assert.IsTrue(theCase.Approved); Assert.IsFalse(theCase.Denied); }
public void ThirteenWeekCaseIsApprovedAndDenied() { EmployeeCase theCase = LogicAndDataAccess.CreateCase(1, new DateTime(2017, 1, 2), new DateTime(2017, 3, 31)); Assert.IsTrue(theCase.Approved); Assert.IsTrue(theCase.Denied); }
public void CaseNumberIsNotDuplicate() { EmployeeCase firstCase = LogicAndDataAccess.CreateCase(1, DateTime.UtcNow, DateTime.UtcNow.AddDays(7)); EmployeeCase secondCase = LogicAndDataAccess.CreateCase(1, DateTime.UtcNow, DateTime.UtcNow.AddDays(7)); Assert.AreNotEqual(firstCase.CaseNumber, secondCase.CaseNumber); }
public JsonResult CreateCase(CaseViewModel newCase) { EmployeeCase theCase = LogicAndDataAccess.CreateCase(newCase.EmployeeId, newCase.StartDate.Value, newCase.EndDate.Value); newCase.Approved = theCase.Approved; newCase.Denied = theCase.Denied; return(Json(newCase)); }
public void SecondCaseIsApprovedAndDenied() { // 11 week case EmployeeCase firstCase = LogicAndDataAccess.CreateCase(1, new DateTime(2017, 1, 2), new DateTime(2017, 3, 17)); Assert.IsTrue(firstCase.Approved); Assert.IsFalse(firstCase.Denied); // two week case EmployeeCase secondCase = LogicAndDataAccess.CreateCase(1, new DateTime(2017, 3, 20), new DateTime(2017, 3, 31)); Assert.IsTrue(secondCase.Approved); Assert.IsTrue(secondCase.Denied); }
public void CreateCaseThrowsExceptionIfStartDateIsBeforeEndDate() { LogicAndDataAccess.CreateCase(1, new DateTime(2017, 3, 20), new DateTime(2017, 3, 19)); }
public void CreateCaseThrowsExceptionsIfEmployeeIdIsNegative() { LogicAndDataAccess.CreateCase(-1, new DateTime(2017, 3, 20), new DateTime(2017, 3, 21)); }