public void Test_For_EndTask(int testTaskIdForDelete, bool expectedResult)
        {
            // Arrange
            mockTaskRepo.Setup(repo => repo.EndTask(testTaskIdForDelete)).Returns(expectedResult);
            // Act
            var actualResult = tasksLogicTest.EndTask(testTaskIdForDelete);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
 public IActionResult EndTask(int taskId)
 {
     try
     {
         return(Ok(taskLogic.EndTask(taskId)));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, $"Error during Ending the Task Id - {taskId}.");
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
Exemplo n.º 3
0
 public IHttpActionResult EndTask(int taskId)
 {
     try
     {
         return(Ok(taskLogic.EndTask(taskId)));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, $"Error during Ending the Task Id - {taskId}.");
         return(InternalServerError(ex));
     }
 }