public DeleteImportNotificationCommentHandlerTest() { this.repo = A.Fake <IImportNotificationCommentRepository>(); this.message = A.Fake <DeleteImportNotificationComment>(); this.handler = new DeleteImportNotificationCommentHandler(this.repo); }
public async Task <ActionResult> Delete(DeleteCommentViewModel model) { var request = new DeleteImportNotificationComment(model.CommentId); await this.mediator.SendAsync(request); DateTime startDate = new DateTime(); DateTime endDate = new DateTime(); int? shipmentNumber = null; string user = string.Empty; GetFilteredTempData(model.Filter, out startDate, out endDate, out shipmentNumber, out user); var comments = await this.mediator.SendAsync(new GetImportNotificationComments(model.NotificationId, model.Type, model.Page, startDate, endDate, shipmentNumber, user)); if (comments.NotificationComments.Count == 0 && model.Page > 1) { model.Page--; } return(RedirectToAction("Index", new { id = model.NotificationId, type = model.Type, page = model.Page, filter = model.Filter })); }