Example #1
0
        public ActionResult Delete(int id)
        {
            ActionConfirmation deleteConfirmation = _orgManagementService.Delete(id);

            TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] =
                deleteConfirmation.Message;
            return(RedirectToAction("Search"));
        }
        public void CanDeleteOrg()
        {
            // Establish Context
            var orgToDelete = new Org();

            _orgRepository.Expect(r => r.Get(1))
            .Return(orgToDelete);

            // Act
            ActionConfirmation confirmation =
                _orgManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }