public DeleteNotificationCommentHandlerTests()
        {
            this.repo = A.Fake <INotificationCommentRepository>();

            this.message = A.Fake <DeleteNotificationComment>();
            this.handler = new DeleteNotificationCommentHandler(this.repo);
        }
Esempio n. 2
0
        public async Task <ActionResult> Delete(DeleteCommentViewModel model)
        {
            var request = new DeleteNotificationComment(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 GetNotificationComments(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 }));
        }