Exemplo n.º 1
0
        public void AddTask()
        {
            taskController = new TaskController();
            TaskModel addTask = new TaskModel();

            addTask.Task      = "Task New One";
            addTask.StartDate = DateTime.Now;
            addTask.EndDate   = DateTime.Now;
            addTask.Priority  = 15;
            addTask.ParentId  = 1;
            addTask.ProjectId = 1;
            JavaScriptSerializer objJavascript = new JavaScriptSerializer();
            var testModels = objJavascript.Serialize(addTask);
            var isAdded    = taskController.AddorUpdateTask(testModels);

            Assert.AreEqual("ADD", isAdded);
        }
Exemplo n.º 2
0
        public void UpdateTask()
        {
            taskController = new TaskController();
            TaskModel updateTask = new TaskModel();

            updateTask.TaskId    = 8;
            updateTask.Task      = "Task - Update Task";
            updateTask.StartDate = DateTime.Now;
            updateTask.EndDate   = DateTime.Now;
            updateTask.Priority  = 15;
            updateTask.ParentId  = 1;
            updateTask.ProjectId = 1;
            JavaScriptSerializer objJavascript = new JavaScriptSerializer();
            var testModels = objJavascript.Serialize(updateTask);
            var isUpdated  = taskController.AddorUpdateTask(testModels);

            Assert.AreEqual("UPDATE", isUpdated);
        }