public ActionResult Delete(int id) { ActionConfirmation deleteConfirmation = _supportTeamManagementService.Delete(id); TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] = deleteConfirmation.Message; return(RedirectToAction("Search")); }
public void CanDeleteSupportTeam() { // Establish Context var supportTeamToDelete = new SupportTeam(); supportTeamRepository.Expect(r => r.Get(1)) .Return(supportTeamToDelete); // Act ActionConfirmation confirmation = supportTeamManagementService.Delete(1); // Assert confirmation.ShouldNotBeNull(); confirmation.WasSuccessful.ShouldBeTrue(); confirmation.Value.ShouldBeNull(); }