예제 #1
0
        public void AddPrerequisityForTaskTest()
        {
            taskGuid      = Tmanager.AddTask(testTask);
            testTask.Name = "prer1";
            Guid         prer1Guid    = Tmanager.AddTask(testTask);
            Prerequisity prerequisity = new Prerequisity();

            prerequisity.TaskId         = taskGuid;
            prerequisity.PrerequisityId = prer1Guid;
            Tmanager.AddPrerequisityForTask(taskGuid, prer1Guid);
            Assert.IsTrue(Tmanager.GetPrerequisitiesIdForTask(taskGuid).First().Equals(prer1Guid));
        }
예제 #2
0
        public void GetPrerequisitiesIdForTaskTest()
        {
            taskGuid      = Tmanager.AddTask(testTask);
            testTask.Name = "prer1";
            Guid prer1Guid = Tmanager.AddTask(testTask);

            testTask.Name = "prer2";
            Guid         prer2Guid    = Tmanager.AddTask(testTask);
            Prerequisity prerequisity = new Prerequisity();

            prerequisity.TaskId         = taskGuid;
            prerequisity.PrerequisityId = prer1Guid;
            prerequisity.PrerequisityId = prer2Guid;
            Tmanager.AddPrerequisityForTask(taskGuid, prer1Guid);
            Tmanager.AddPrerequisityForTask(taskGuid, prer2Guid);
            var ret = Tmanager
                      .GetPrerequisitiesForTask(taskGuid)
                      .Count(task => task.Id == prer1Guid || task.Id == prer2Guid);

            Assert.IsTrue(ret == 2);
        }