public async Task <IActionResult> Remove(Remove.Command command)
        {
            await this.mediator.SendAsync(command);

            TempData.SetSuccessMessage(SuccessMessages.SuccessfullyRemovedCategory(command.Name));
            return(this.RedirectToActionJson("Categories", "Admin"));
        }
Exemplo n.º 2
0
        public async Task SuccessfullRemoveSetsSuccessMessage(SliceFixture fixture)
        {
            // Arrange
            var category   = AddCategoryToDatabase(fixture);
            var controller = fixture.GetController <CategoryController>();

            // Act
            var removeCommand = new Remove.Command {
                Id = category.Id
            };
            await controller.Remove(removeCommand);

            // Assert
            controller.TempData
            .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyRemovedCategory(removeCommand.Name));
        }