Ejemplo n.º 1
0
        public void Task_Delete()
        {
            var task = TaskService.TaskNew();

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            TaskService.TaskDelete(task.TaskId);

            try
            {
                TaskService.TaskFetch(task.TaskId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }
Ejemplo n.º 2
0
        public void Task_Fetch_List()
        {
            var task = TaskService.TaskNew();

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            TaskService.TaskSave(task);

            task = TaskService.TaskNew();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            TaskService.TaskSave(task);

            var tasks = TaskService.TaskFetchInfoList();

            Assert.IsTrue(tasks.Count > 1, "Tasks should be greater than one");
        }
Ejemplo n.º 3
0
        public void Task_Edit_With_Task_Labels()
        {
            var task        = TaskService.TaskNew();
            var description = DataHelper.RandomString(1000);

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            task.TaskLabels.Add("AAAAA");
            task.TaskLabels.Add("BBBBB");
            task.TaskLabels.Add("CCCCC");
            task.TaskLabels.Add("DDDDD");
            task.TaskLabels.Add("EEEEE");

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            task.TaskLabels.Remove("AAAAA");

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            Assert.IsTrue(task.TaskLabels.Count == 4, "TaskLabels count should be 4, but is {0}", task.TaskLabels.Count);
        }
Ejemplo n.º 4
0
        public void Task_Edit()
        {
            var task        = TaskService.TaskNew();
            var description = DataHelper.RandomString(1000);

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            task.Description = DataHelper.RandomString(1000);

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            Assert.IsTrue(task.Description != description, "Description should have different value");
        }
Ejemplo n.º 5
0
        public void Task_Edit_Status_To_Completed()
        {
            var task = TaskService.TaskNew();

            var status = BusinessHelper.CreateStatus();

            status.IsCompleted = true;

            StatusService.StatusSave(status);

            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            Assert.IsTrue(task.CompletedDate == DateTime.MaxValue.Date, "StartDate should be empty");
            Assert.IsTrue(task.EstimatedCompletedDate == DateTime.MaxValue.Date, "EstimatedCompletedDate should be empty");

            task.StatusId = status.StatusId;

            Assert.IsTrue(task.CompletedDate == DateTime.Now.Date, "CompletedDate should be equal to today's date");
            Assert.IsTrue(task.EstimatedCompletedDate == DateTime.Now.Date, "EstimatedCompletedDate should be equal to today's date");
        }
Ejemplo n.º 6
0
        public void Task_Add_With_Task_Labels()
        {
            var task = TaskService.TaskNew();

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            task.TaskLabels.Add(DataHelper.RandomString(30));
            task.TaskLabels.Add(DataHelper.RandomString(30));
            task.TaskLabels.Add(DataHelper.RandomString(30));
            task.TaskLabels.Add(DataHelper.RandomString(30));
            task.TaskLabels.Add(DataHelper.RandomString(30));

            Assert.IsTrue(task.IsValid, "IsValid should be true");

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            Assert.IsTrue(task.TaskLabels.Count == 5, "TaskLabels count should be 5, but is {0}", task.TaskLabels.Count);
        }
Ejemplo n.º 7
0
        public void Task_Add()
        {
            var task = TaskService.TaskNew();

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            Assert.IsTrue(task.IsValid, "IsValid should be true");

            TaskService.TaskSave(task);
        }
Ejemplo n.º 8
0
        public void Task_Fetch()
        {
            var task = TaskService.TaskNew();

            var status   = BusinessHelper.CreateStatus();
            var category = BusinessHelper.CreateCategory();
            var project  = BusinessHelper.CreateProject();

            task.Description = DataHelper.RandomString(1000);
            task.StatusId    = status.StatusId;
            task.CategoryId  = category.CategoryId;
            task.ProjectId   = project.ProjectId;

            task = TaskService.TaskSave(task);

            task = TaskService.TaskFetch(task.TaskId);

            Assert.IsFalse(task == null, "Task should not be null");
        }