Ejemplo n.º 1
0
        public void TaskManger_AddTask_Test2()
        {
            TaskManager.ClearGroups();
            DailyTask task = new DailyTask()
            {
                Title = "Title", TaskItems = new List <TaskItem> {
                    new TaskItem {
                        Content = "Content"
                    }
                }, Date = DateTime.Now
            };
            CustomTasks doingTasks   = DoingTasks.Instance;
            CustomTasks deletedTasks = FinishTasks.Instance;

            TaskManager.AddGroup(doingTasks);
            TaskManager.AddGroup(deletedTasks);
            TaskManager.AddTask(doingTasks, task);

            Assert.IsTrue(TaskManager.GetTaskGroups().Count == 2, TaskManager.GetTaskGroups().Count.ToString());
            Assert.IsNotNull(TaskManager.GetTaskGroup(task.GroupId));
            Assert.AreEqual(1, TaskManager.GetTaskGroup(task.GroupId).DailyTasks.Count);

            TaskManager.MoveTask(deletedTasks, task);
            Assert.AreEqual(TaskManager.GetTaskGroup(task.GroupId).GroupId, FinishTasks.GUID);
        }
Ejemplo n.º 2
0
        public void ManagerTaskJosnSave_Test()
        {
            var doingTasks  = DoingTasks.Instance;
            var finishTasks = FinishTasks.Instance;

            doingTasks.DailyTasks = new System.Collections.Generic.List <DailyTask>()
            {
                new DailyTask {
                    Title = "Title1", TaskItems = new List <TaskItem> {
                        new TaskItem {
                            Content = "Content1"
                        }
                    }
                },
                new DailyTask {
                    Title = "Title2", TaskItems = new List <TaskItem> {
                        new TaskItem {
                            Content = "Content2"
                        }
                    }
                },
                new DailyTask {
                    Title = "Title3", TaskItems = new List <TaskItem> {
                        new TaskItem {
                            Content = "Content3"
                        }
                    }
                },
                new DailyTask {
                    Title = "Title4", TaskItems = new List <TaskItem> {
                        new TaskItem {
                            Content = "Content4"
                        }
                    }
                }
            };

            finishTasks.DailyTasks = new System.Collections.Generic.List <DailyTask>()
            {
                new DailyTask {
                    Title = "Title0", TaskItems = new List <TaskItem> {
                        new TaskItem {
                            Content = "Content0"
                        }
                    }
                }
            };

            TaskManager.AddGroup(doingTasks);
            TaskManager.AddGroup(finishTasks);

            FileHelper.SaveJosn(TaskManager.ConvertFormatJson());

            Assert.IsTrue(File.Exists(FileHelper.FilePath));
            Assert.AreEqual(File.ReadAllText(FileHelper.FilePath, Encoding.UTF8), TaskManager.ConvertFormatJson());
        }
Ejemplo n.º 3
0
        public TestModel()
        {
            CustomTasks doingGroup  = DoingTasks.Instance;
            CustomTasks deleteGroup = FinishTasks.Instance;

            TaskManager.AddGroup(doingGroup);
            TaskManager.AddGroup(deleteGroup);

            DailyTask dt1 = new DailyTask()
            {
                Title = "Task1", TaskItems = new List <TaskItem> {
                    new TaskItem {
                        Content = "Content1\r\nContent_1"
                    }
                }
            };
            DailyTask dt2 = new DailyTask()
            {
                Title = "Task2", TaskItems = new List <TaskItem> {
                    new TaskItem {
                        Content = "Content2"
                    }
                }
            };
            DailyTask dt3 = new DailyTask()
            {
                Title = "Task3", TaskItems = new List <TaskItem> {
                    new TaskItem {
                        Content = "Content3"
                    }
                }
            };
            DailyTask dt4 = new DailyTask()
            {
                Title = "Task4", TaskItems = new List <TaskItem> {
                    new TaskItem {
                        Content = "Content4"
                    }
                }
            };

            TaskManager.AddTask(doingGroup, dt1);
            TaskManager.AddTask(doingGroup, dt2);
            TaskManager.AddTask(doingGroup, dt3);
            TaskManager.AddTask(doingGroup, dt4);
        }