Пример #1
0
        //Performance checking for update list item
        public void UpdateTaskTest()
        {
            Task task = new Task {
                Task_ID = 1, TaskName = "Task 1", Parent = null, Start_Date = DateTime.Now.AddDays(-10), End_Date = DateTime.Now.AddDays(5), Parent_ID = null, Priority = 10
            };

            blObj.UpdateTask(task);
        }
 //Method used to update existing task
 public IHttpActionResult UpdateTask([FromBody] Task editTask)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     blObject = new TaskManagerBL();
     blObject.UpdateTask(editTask);
     return(Ok());
 }
 public IHttpActionResult UpdateTask(DataLayer.Tasks t)
 {
     try
     {
         taskBL.UpdateTask(t);
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
     return(StatusCode(HttpStatusCode.OK));
 }
Пример #4
0
        public void UpdateTask([FromBody] TaskModel task)
        {
            TaskBL blTask = new TaskBL
            {
                TaskID     = task.TaskID,
                ParentTask = task.ParentTask,
                Priority   = task.Priority,
                StartDate  = task.StartDate,
                EndDate    = task.EndDate
            };

            taskManagerBL.UpdateTask(blTask);
        }
Пример #5
0
        // PUT: api/TaskManager/5
        public void UpdateTask([FromBody] Task task)
        {
            TaskManagerBL taskManagerBL = new TaskManagerBL();

            taskManagerBL.UpdateTask(new DA.Task()
            {
                Task_ID    = task.TaskId,
                Task1      = task.Name,
                Parent__ID = task.ParentId,
                Priority   = task.Priority,
                End_Date   = Convert.ToDateTime(task.EndDate),
                Start_Date = Convert.ToDateTime(task.StartDate)
            });
        }
Пример #6
0
        //Test Method for Update List Items
        public void UpdateTaskTest()
        {
            Task task = new Task {
                Task_ID = 1, TaskName = "Task 1", Parent = null, Start_Date = DateTime.Now.AddDays(-10), End_Date = DateTime.Now.AddDays(5), Parent_ID = null, Priority = 10
            };

            try
            {
                blObj.UpdateTask(task);
                Assert.IsTrue(1 == 1);
            }
            catch
            {
                Assert.Inconclusive("Task not updated");
            }
        }
Пример #7
0
        public void UpdateTaskTest()
        {
            Mock <TaskManagerEntities> mockContext = MockDataSetList();
            var    taskManagerBL = new TaskManagerBL(mockContext.Object);
            TaskBL model         = new TaskBL
            {
                TaskID     = 1,
                Task       = "Task 5",
                ParentTask = "Task 2",
                Priority   = 5,
                StartDate  = DateTime.Today,
                EndDate    = DateTime.Today.AddDays(10)
            };

            int result = taskManagerBL.UpdateTask(model);

            Assert.IsTrue(result == 0);
        }
        public void Test_UpdateTask()
        {
            TaskModel objTsk = new TaskModel()
            {
                TaskID         = 19,
                TaskName       = "Task7_Updt",
                ParentTaskID   = 12,
                ParentTaskName = "ParentTask7_Updt",
                StartDate      = new DateTime(2018, 09, 11),
                EndDate        = new DateTime(2018, 09, 16),
                Priority       = 21
            };
            Mock <ITaskDbService> mockDb = new Mock <ITaskDbService>();
            TaskManagerBL         obj    = new TaskManagerBL(mockDb.Object);

            obj.UpdateTask(objTsk);
            mockDb.Verify(c => c.UpdateTask(It.IsAny <Task>()), Times.Once);
        }