public void CanDeletePerson()
        {
            // Establish Context
            var personToDelete = new Person();

            _personRepository.Expect(r => r.Get(1))
            .Return(personToDelete);

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

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
Beispiel #2
0
        public ActionResult Delete(int id)
        {
            ActionConfirmation deleteConfirmation = _personManagementService.Delete(id);

            TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] =
                deleteConfirmation.Message;
            return(RedirectToAction("Search"));
        }