Ejemplo n.º 1
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.º 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_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.º 4
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.º 5
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.º 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 Sprint_Add()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

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

            SprintService.SprintSave(sprint);
        }
Ejemplo n.º 8
0
        public void Sprint_Fetch()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

            sprint = SprintService.SprintSave(sprint);

            sprint = SprintService.SprintFetch(sprint.SprintId);

            Assert.IsFalse(sprint == null, "Sprint should not be null");
        }
Ejemplo n.º 9
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.º 10
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");
        }
Ejemplo n.º 11
0
        public void Sprint_Add_With_Duplicate_Name()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();
            var name    = DataHelper.RandomString(20);

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = name;

            SprintService.SprintSave(sprint);

            sprint = SprintService.SprintNew();

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = name;

            Assert.IsTrue(ValidationHelper.ContainsRule(sprint, "rule://epiworx.business.sprintduplicatenamecheck/Name"),
                          "Name should not be duplicated");
        }
Ejemplo n.º 12
0
        public void Sprint_Fetch_List()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

            sprint = SprintService.SprintSave(sprint);

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

            SprintService.SprintSave(sprint);

            var sprints = SprintService.SprintFetchInfoList();

            Assert.IsTrue(sprints.Count > 1, "Sprints should be greater than one");
        }
Ejemplo n.º 13
0
        public void Sprint_Edit()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();
            var name    = DataHelper.RandomString(20);

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = name;

            sprint = SprintService.SprintSave(sprint);

            sprint = SprintService.SprintFetch(sprint.SprintId);

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

            sprint = SprintService.SprintSave(sprint);

            sprint = SprintService.SprintFetch(sprint.SprintId);

            Assert.IsTrue(sprint.Name != name, "Name should have different value");
        }
Ejemplo n.º 14
0
        public void Sprint_Delete()
        {
            var sprint  = SprintService.SprintNew();
            var project = BusinessHelper.CreateProject();

            sprint.ProjectId = project.ProjectId;
            sprint.Name      = DataHelper.RandomString(20);

            sprint = SprintService.SprintSave(sprint);

            sprint = SprintService.SprintFetch(sprint.SprintId);

            SprintService.SprintDelete(sprint.SprintId);

            try
            {
                SprintService.SprintFetch(sprint.SprintId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }