public async Task Create_ReturnsNewlyCreatedTask()
        {
            // Arrange
            var mockRepo   = new Mock <ITaskDetailsRepository>();
            var controller = new TaskDetailController(mockRepo.Object);

            var newTaskDetail = new TaskDetail()
            {
                TaskName    = "Task 101",
                StartDate   = DateTime.Today,
                EndDate     = DateTime.Today.AddDays(50),
                IsCompleted = false,
                Priority    = 24,
                ParentTask  = 5,
                TaskId      = 101
            };

            // Act
            var result = await controller.PostTaskDetail(newTaskDetail);

            // Assert
            var actionResult          = Assert.IsType <ActionResult <TaskDetail> >(result);
            var createdAtActionResult = Assert.IsType <CreatedAtActionResult>(actionResult.Result);

            var returnValue = Assert.IsType <TaskDetail>(createdAtActionResult.Value);

            mockRepo.Verify();

            Assert.Equal(newTaskDetail.TaskName, returnValue.TaskName);
            Assert.Equal(newTaskDetail.TaskId, returnValue.TaskId);
        }
        public async Task Create_ReturnsBadRequest_GivenInvalidModel()
        {
            // Arrange
            var mockRepo   = new Mock <ITaskDetailsRepository>();
            var controller = new TaskDetailController(mockRepo.Object);

            // Act
            var result = await controller.PostTaskDetail(taskDetail : null);

            // Assert
            var actionResult = Assert.IsType <ActionResult <TaskDetail> >(result);

            Assert.IsType <BadRequestObjectResult>(actionResult.Result);
        }