public void AddTask()
        {
            TaskBLL taskBLL = new TaskBLL();

            taskBLL.CreateTask(taskObj);
            Task createdTaskObj = taskBLL.GetAll().Last();

            Assert.AreEqual(createdTaskObj.TaskName, "Test Task");
            Assert.AreEqual(createdTaskObj.Priority, 3);
        }
Esempio n. 2
0
 public IHttpActionResult Put(Task task)
 {
     try
     {
         if (ModelState.IsValid)
         {
             TaskBLL taskBLL = new TaskBLL();
             taskBLL.UpdateTask(task);
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }