public void ReceivedDate_InPast_Valid() { NotificationReceivedDateViewModel model = new NotificationReceivedDateViewModel(); model.NotificationReceived = new OptionalDateInputViewModel(SystemTime.UtcNow.AddDays(-1)); var controller = GetMockAssessmentController(model); controller.ReceivedDate(model); Assert.True(controller.ModelState.IsValid); }
public void ReceivedDate_InFuture_NotValid() { NotificationReceivedDateViewModel model = new NotificationReceivedDateViewModel(); model.NotificationReceived = new OptionalDateInputViewModel(SystemTime.UtcNow.AddDays(1)); var controller = GetMockAssessmentController(model); controller.ReceivedDate(model); Assert.True(controller.ModelState.ContainsKey("NotificationReceived")); }
public ActionResult ReceivedDate(NotificationReceivedDateViewModel model) { if (!ModelState.IsValid) { return View(model); } TempData[ImportNotificationNumber] = model.NotificationNumber; TempData[ImportNotificationReceivedDate] = model.NotificationReceived.AsDateTime().Value; return RedirectToAction("NotificationType"); }
public ActionResult ReceivedDate(NotificationReceivedDateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } TempData[ImportNotificationNumber] = model.NotificationNumber; TempData[ImportNotificationReceivedDate] = model.NotificationReceived.AsDateTime().Value; return(RedirectToAction("NotificationType")); }