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