Ejemplo n.º 1
0
        public ActionResult DeleteTimeEntry(int id)
        {
            ActionConfirmation deleteConfirmation = _timeEntryManagementService.Delete(id);

            TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] =
                deleteConfirmation.Message;
            return(Json(true));
        }
Ejemplo n.º 2
0
        public void CanDeleteTimeEntry()
        {
            // Establish Context
            var timeEntryToDelete = new TimeEntry();

            _timeEntryRepository.Expect(r => r.Get(1))
            .Return(timeEntryToDelete);

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

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