public async Task <IActionResult> Edit(Edit.Command command) { await this.mediator.SendAsync(command); TempData.SetSuccessMessage(SuccessMessages.SuccessfullyEditedRole(command.Name)); return(this.RedirectToActionJson("Roles", "Admin")); }
public async Task SuccessfullEditSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <RoleController>(); var role = AddRoleToDb(fixture); // Act var editCommand = new Edit.Command { Name = "Edited name" }; await controller.Edit(editCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyEditedRole(editCommand.Name)); }