本文整理汇总了C#中ProjectManager.IsSplit方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectManager.IsSplit方法的具体用法?C# ProjectManager.IsSplit怎么用?C# ProjectManager.IsSplit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager
的用法示例。
在下文中一共展示了ProjectManager.IsSplit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeletePartCausingMerge
public void DeletePartCausingMerge()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: create a split task with resources on parts
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
// test: delete a part, expect a merge to regular task
manager.Delete(part1);
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
}
示例2: SplitNullPart
public void SplitNullPart()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
var part3 = new Task();
manager.Add(split);
// setup: create a split task
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(!manager.IsPart(part3));
// test: split a null part (no effect);
manager.Split(null, part3, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(!manager.IsPart(part3));
// test: split a null part (no effect);
manager.Split(part1, null, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(!manager.IsPart(part3));
}
示例3: DeleteMiddlePart
public void DeleteMiddlePart()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
var part3 = new Task();
manager.Add(split);
// setup: create a 3 part split task
manager.SetDuration(split, 30);
manager.Split(split, part1, part2, 4);
manager.Split(part2, part3, 5);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Start == 0);
Assert.IsTrue(part2.Start == 5);
Assert.IsTrue(part3.Start == 11);
Assert.IsTrue(part1.Duration == 4);
Assert.IsTrue(part2.Duration == 5);
Assert.IsTrue(part3.Duration == 21);
Assert.IsTrue(split.Start == 0);
Assert.IsTrue(split.End == 32);
// test: delete part2, part1 and part3 should not be affected
manager.Delete(part2);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Duration == 4);
Assert.IsTrue(part3.Duration == 21);
Assert.IsTrue(part1.Start == 0);
Assert.IsTrue(part3.Start == 11);
Assert.IsTrue(part3.End == 32);
Assert.IsTrue(split.Start == 0);
Assert.IsTrue(split.End == 32);
}
示例4: GroupPartsBecomeGroupSplitTask
public void GroupPartsBecomeGroupSplitTask()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task() { Name = "split" };
var part1 = new Task() { Name = "part1" };
var part2 = new Task() { Name = "part2" };
var group = new Task() { Name = "group" };
var task = new Task() { Name = "task" };
manager.Add(split);
manager.Add(group);
manager.Add(task);
// setup: create a split task and a group
manager.Split(split, part1, part2, 2);
manager.Group(group, task);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsGroup(group));
Assert.IsTrue(manager.IsMember(task));
// test: group part into task;
manager.Group(group, part1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsGroup(group));
Assert.IsTrue(manager.IsMember(task));
Assert.IsTrue(!manager.IsMember(part1));
Assert.IsTrue(manager.IsMember(split));
Assert.IsTrue(manager.ChildrenOf(group).Count() == 2);
Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
Assert.IsTrue(manager.ChildrenOf(group).Contains(split));
// test: group task into part (no effect)
manager.Group(part1, task);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsGroup(group));
Assert.IsTrue(manager.IsMember(task));
Assert.IsTrue(!manager.IsMember(part1));
Assert.IsTrue(!manager.IsGroup(part1));
Assert.IsTrue(manager.ChildrenOf(group).Count() == 2);
Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
Assert.IsTrue(manager.ChildrenOf(group).Contains(split));
}
示例5: SplitTaskAndConfirmStructure
public void SplitTaskAndConfirmStructure()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: confirm task type status
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsSplit(part1));
Assert.IsTrue(!manager.IsSplit(part2));
Assert.IsTrue(!manager.IsPart(split));
Assert.IsTrue(!manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
// test: split the task into part1 and part2 and see resulting structure
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(!manager.IsPart(split));
Assert.IsTrue(!manager.IsSplit(part1));
Assert.IsTrue(!manager.IsSplit(part2));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
Assert.IsTrue(manager.PartsOf(split).Contains(part1));
Assert.IsTrue(manager.PartsOf(split).Contains(part2));
}
示例6: SplitTaskUsingSamePartsNoEffect
public void SplitTaskUsingSamePartsNoEffect()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part = new Task();
manager.Add(split);
// setup: confirm no splits and parts
Assert.IsTrue(!manager.IsPart(split));
Assert.IsTrue(!manager.IsPart(part));
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part));
// test: split using part and part
manager.Split(split, part, part, 1);
Assert.IsTrue(!manager.IsPart(split));
Assert.IsTrue(!manager.IsPart(part));
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part));
}
示例7: JoinPartFromDifferentSplitTask
public void JoinPartFromDifferentSplitTask()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split1 = new Task();
var part1a = new Task();
var part1b = new Task();
var split2 = new Task();
var part2a = new Task();
var part2b = new Task();
manager.Add(split1);
manager.Add(split2);
// setup: create 2 split tasks
manager.Split(split1, part1a, part1b, 1);
manager.Split(split2, part2a, part2b, 1);
Assert.IsTrue(manager.IsSplit(split1));
Assert.IsTrue(manager.IsSplit(split2));
Assert.IsTrue(manager.IsPart(part1a));
Assert.IsTrue(manager.IsPart(part1b));
Assert.IsTrue(manager.IsPart(part2a));
Assert.IsTrue(manager.IsPart(part2b));
Assert.IsTrue(manager.PartsOf(split1).Count() == 2);
Assert.IsTrue(manager.PartsOf(split1).Contains(part1a));
Assert.IsTrue(manager.PartsOf(split1).Contains(part1b));
Assert.IsTrue(manager.PartsOf(split2).Count() == 2);
Assert.IsTrue(manager.PartsOf(split2).Contains(part2a));
Assert.IsTrue(manager.PartsOf(split2).Contains(part2b));
// test: join part1x with part2x (no effect)
manager.Join(part1a, part2a);
Assert.IsTrue(manager.IsSplit(split1));
Assert.IsTrue(manager.IsSplit(split2));
Assert.IsTrue(manager.IsPart(part1a));
Assert.IsTrue(manager.IsPart(part1b));
Assert.IsTrue(manager.IsPart(part2a));
Assert.IsTrue(manager.IsPart(part2b));
Assert.IsTrue(manager.PartsOf(split1).Count() == 2);
Assert.IsTrue(manager.PartsOf(split1).Contains(part1a));
Assert.IsTrue(manager.PartsOf(split1).Contains(part1b));
Assert.IsTrue(manager.PartsOf(split2).Count() == 2);
Assert.IsTrue(manager.PartsOf(split2).Contains(part2a));
Assert.IsTrue(manager.PartsOf(split2).Contains(part2b));
}
示例8: SplitPartUsingSamePartsNoEffect
public void SplitPartUsingSamePartsNoEffect()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: create a split
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0).Equals(part1));
Assert.IsTrue(manager.PartsOf(split).ElementAt(1).Equals(part2));
// test: split part1 using part1
manager.Split(part1, part1, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0).Equals(part1));
Assert.IsTrue(manager.PartsOf(split).ElementAt(1).Equals(part2));
}
示例9: JoinIntoMerge
public void JoinIntoMerge()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: create a split task
manager.Split(split, part1, part2, 7);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
// test: join the two parts, resulting in split becoming back ito regular task
manager.Join(part1, part2);
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
}
示例10: JoinPartConfirmSchedule
public void JoinPartConfirmSchedule()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
var part3 = new Task();
manager.Add(split);
// setup: create a 3 part split
manager.SetStart(split, 16);
manager.SetDuration(split, 24);
manager.Split(split, part1, part2, 8);
manager.Split(part2, part3, 8);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.PartsOf(split).Count() == 3);
Assert.IsTrue(part1.Duration == 8);
Assert.IsTrue(part2.Duration == 8);
Assert.IsTrue(part3.Duration == 8);
Assert.IsTrue(split.Duration == 26);
Assert.IsTrue(split.Start == 16);
Assert.IsTrue(split.End == 42);
// setup: join parts 1 and 2, intentionally in bad order, but should still work
manager.Join(part2, part1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
Assert.IsTrue(part2.Duration == 16);
Assert.IsTrue(part3.Duration == 8);
Assert.IsTrue(split.Duration == 26); // schedule of other parts not affected
Assert.IsTrue(split.Start == 16);
Assert.IsTrue(split.End == 42);
}
示例11: SetSplitTaskStartMaintainPartsRelativeSchedule
public void SetSplitTaskStartMaintainPartsRelativeSchedule()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
var part3 = new Task();
manager.Add(split);
// setup: create a split task
manager.Split(split, part1, part2, 1);
manager.Split(part2, part3, 1);
manager.SetStart(part1, 0);
manager.SetStart(part2, 15);
manager.SetStart(part3, 30);
manager.SetDuration(part1, 3);
manager.SetDuration(part2, 4);
manager.SetDuration(part3, 5);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Start == 0);
Assert.IsTrue(part2.Start == 15);
Assert.IsTrue(part3.Start == 30);
Assert.IsTrue(part1.Duration == 3);
Assert.IsTrue(part2.Duration == 4);
Assert.IsTrue(part3.Duration == 5);
Assert.IsTrue(part1.End == 3);
Assert.IsTrue(part2.End == 19);
Assert.IsTrue(part3.End == 35);
// test: move the split task itself - maintain interrupts
var offset = 10 - split.Start;
manager.SetStart(split, 10);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Start == 0 + offset);
Assert.IsTrue(part2.Start == 15 + offset);
Assert.IsTrue(part3.Start == 30 + offset);
Assert.IsTrue(part1.Duration == 3);
Assert.IsTrue(part2.Duration == 4);
Assert.IsTrue(part3.Duration == 5);
Assert.IsTrue(part1.End == 3 + offset);
Assert.IsTrue(part2.End == 19 + offset);
Assert.IsTrue(part3.End == 35 + offset);
}
示例12: SetSplitTaskEndLastTaskMinimun1UnitTime
public void SetSplitTaskEndLastTaskMinimun1UnitTime()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
var part3 = new Task();
manager.Add(split);
// setup: create a split task
manager.Split(split, part1, part2, 1);
manager.Split(part2, part3, 1);
manager.SetStart(part1, 0);
manager.SetStart(part2, 15);
manager.SetStart(part3, 30);
manager.SetDuration(part1, 3);
manager.SetDuration(part2, 4);
manager.SetDuration(part3, 5);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Start == 0);
Assert.IsTrue(part2.Start == 15);
Assert.IsTrue(part3.Start == 30);
Assert.IsTrue(part1.Duration == 3);
Assert.IsTrue(part2.Duration == 4);
Assert.IsTrue(part3.Duration == 5);
Assert.IsTrue(part1.End == 3);
Assert.IsTrue(part2.End == 19);
Assert.IsTrue(part3.End == 35);
// test: set the split task end - last part end to increase or decrease,
// resulting no less than 1 unit duration
manager.SetEnd(split, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(part1.Start == 0);
Assert.IsTrue(part2.Start == 15);
Assert.IsTrue(part3.Start == 30);
Assert.IsTrue(part1.Duration == 3);
Assert.IsTrue(part2.Duration == 4);
Assert.IsTrue(part3.Duration == 1);
Assert.IsTrue(part1.End == 3);
Assert.IsTrue(part2.End == 19);
Assert.IsTrue(part3.End == 31);
// test: increase split task end and last part adjust accordingly
manager.SetEnd(split, 100);
Assert.IsTrue(part3.End == 100);
Assert.IsTrue(part3.Duration == 70);
Assert.IsTrue(part3.Start == 30);
}
示例13: DeletePartsOnDeleteSplitTask
public void DeletePartsOnDeleteSplitTask()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: create a split task with resources on parts
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.Tasks.Count() == 1);
// test: ensure that we cannot add the tasks parts and split again
manager.Add(split);
manager.Add(part1);
manager.Add(part2);
Assert.IsTrue(manager.Tasks.Count() == 1);
// test: delete a part, expect a merge to regular task
manager.Delete(split);
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
Assert.IsTrue(manager.Tasks.Count() == 0);
// test: if really deleted, we should be able to add them back
manager.Add(split);
Assert.IsTrue(manager.Tasks.Count() == 1);
// test: now we should be able to add again
manager.Add(split);
manager.Add(part1);
manager.Add(part2);
Assert.IsTrue(manager.Tasks.Count() == 3);
}
示例14: SplitPart
public void SplitPart()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task() { Name = "part1" };
var part2 = new Task() { Name = "part2" };
var part3 = new Task() { Name = "part3" };
var part4 = new Task() { Name = "part4" };
manager.Add(split);
// setup: set up a split task
manager.Split(split, part1, part3, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(!manager.IsPart(part4));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
var ele = manager.PartsOf(split);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0).Equals(part1));
Assert.IsTrue(manager.PartsOf(split).ElementAt(1).Equals(part3));
Assert.IsTrue(split.Start == part1.Start);
Assert.IsTrue(split.End == part3.End);
// test: split part3 to give part3 and part4
manager.Split(part3, part4, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(manager.IsPart(part4));
Assert.IsTrue(manager.PartsOf(split).Count() == 3);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0).Equals(part1));
Assert.IsTrue(manager.PartsOf(split).ElementAt(1).Equals(part3));
Assert.IsTrue(manager.PartsOf(split).ElementAt(2).Equals(part4));
Assert.IsTrue(split.Start == part1.Start);
Assert.IsTrue(split.End == part4.End);
// test: split part1 to give part1 and part2
manager.Split(part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.IsPart(part3));
Assert.IsTrue(manager.IsPart(part4));
Assert.IsTrue(manager.PartsOf(split).Count() == 4);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0) == part1);
Assert.IsTrue(manager.PartsOf(split).ElementAt(1) == part2);
Assert.IsTrue(manager.PartsOf(split).ElementAt(2) == part3);
Assert.IsTrue(manager.PartsOf(split).ElementAt(3) == part4);
Assert.IsTrue(split.Start == part1.Start);
Assert.IsTrue(split.End == part4.End);
// test: ensure no parts overlap
Assert.IsTrue(part1.End < part2.Start);
Assert.IsTrue(part2.End < part3.Start);
Assert.IsTrue(part3.End < part4.Start);
Assert.IsTrue(part1.Start < part1.End);
Assert.IsTrue(part4.Start < part4.End);
}
示例15: JoinPartRemainSinglePartBecomeRegularTask
public void JoinPartRemainSinglePartBecomeRegularTask()
{
IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
var split = new Task();
var part1 = new Task();
var part2 = new Task();
manager.Add(split);
// setup: create split task with only part1 and part2
manager.Split(split, part1, part2, 1);
Assert.IsTrue(manager.IsSplit(split));
Assert.IsTrue(manager.IsPart(part1));
Assert.IsTrue(manager.IsPart(part2));
Assert.IsTrue(manager.PartsOf(split).Count() == 2);
Assert.IsTrue(manager.PartsOf(split).ElementAt(0) == part1);
Assert.IsTrue(manager.PartsOf(split).ElementAt(1) == part2);
// test: join the 2 parts, leave only a non-split task left
manager.Join(part1, part2);
Assert.IsTrue(!manager.IsSplit(split));
Assert.IsTrue(!manager.IsPart(part1));
Assert.IsTrue(!manager.IsPart(part2));
Assert.IsTrue(split.Duration == 2);
}