public void TestGet()
        {
            TaskManagerController taskManagerController = new TaskManagerController();

            taskManagerController.Add(new Models.Task()
            {
                Name = "GetTask1", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(10), ParentId = 1, Priority = 10
            });
            taskManagerController.Add(new Models.Task()
            {
                Name = "GetTask2", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(10), ParentId = 1, Priority = 10
            });
            IEnumerable <Task> tasks = taskManagerController.Get();

            Assert.IsNotNull(tasks);
            int  taskId = tasks.FirstOrDefault().TaskId;
            Task task   = taskManagerController.Get(taskId);

            Assert.IsNotNull(task);
        }
        public void TestAdd()
        {
            TaskManagerController taskManagerController = new TaskManagerController();

            taskManagerController.Add(new Models.Task()
            {
                Name = "AddTask", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(10), ParentId = 1, Priority = 10
            });
            IEnumerable <Task> tasks = taskManagerController.Get();

            Assert.IsNotNull(tasks);
            Assert.IsNotNull(tasks.Where(t => t.Name == "AddTask").First());
        }
        public void TestUpdate()
        {
            TaskManagerController taskManagerController = new TaskManagerController();

            taskManagerController.Add(new Models.Task()
            {
                Name = "TestUpdate1", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(10), ParentId = 1, Priority = 10
            });
            IEnumerable <Task> tasks = taskManagerController.Get();

            Assert.IsNotNull(tasks);
            Task   task    = tasks.Where(t => t.Name == "TestUpdate1").FirstOrDefault();
            string newName = task.Name + "Renamed";

            task.Name = newName;
            taskManagerController.Update(task);
            task = taskManagerController.Get(task.TaskId);
            Assert.IsTrue(task.Name == newName);
        }