Exemplo n.º 1
0
        public void TestLeafEngineers()
        {
            LeafTask task = new LeafTask(0, "TASK", "Test Task", 15);
            Engineer e = new Engineer() { ID = 0, Name = "Test", HoursAvailable = 24 };

            task.AddEngineer(e);
            task.AddEngineer(null);

            Assert.That(task.AssignedEngineers.Count, Is.EqualTo(1));
            Assert.That(task.AssignedEngineers[0], Is.EqualTo(e));

            task.RemoveEngineer(null);
            task.RemoveEngineer(e);

            Assert.That(task.AssignedEngineers.Count, Is.EqualTo(0));
        }
Exemplo n.º 2
0
        public void TestLeafEstimatedDays()
        {
            LeafTask task = new LeafTask(0, "TASK", "Test Task", 15);
            Engineer e = new Engineer() { ID = 0, Name = "Test", HoursAvailable = 2 };
            Engineer e2 = new Engineer() { ID = 0, Name = "Test", HoursAvailable = 3 };

            task.AddEngineer(e);
            task.AddEngineer(e2);

            Assert.That(task.EstimatedDaysToComplete, Is.EqualTo(3));

            task.HoursWorked = 8;

            Assert.That(task.EstimatedRemainingHours, Is.EqualTo(7));
            Assert.That(task.EstimatedDaysToComplete, Is.EqualTo(2));

            task.RemoveEngineer(e);
            task.RemoveEngineer(e2);

            Assert.That(task.EstimatedDaysToComplete, Is.EqualTo(-1));
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            parallelTask = new ParallelParentTask(0, "TASK", "Test");
            sequentialTask = new SequentialParentTask(0, "TASK", "Test");
            emptyTask = new SequentialParentTask(0, "TASK", "Test");

            leaf1 = new LeafTask(1, "LEAF1", "Awesome Task", HOURS);
            leaf2 = new LeafTask(2, "LEAF2", "More Awesome Task", HOURS);

            e = new Engineer() { ID = 0, HoursAvailable = HOURS / 2, Name = "Test" };
            e2 = new Engineer() { ID = 1, HoursAvailable = HOURS / 2, Name = "Test" };

            leaf1.AddEngineer(e);
            leaf2.AddEngineer(e2);

            parallelTask.AddTask(leaf1);
            parallelTask.AddTask(leaf2);

            sequentialTask.AddTask(leaf1);
            sequentialTask.AddTask(leaf1);
        }
Exemplo n.º 4
0
 public void RemoveEngineer(Engineer e)
 {
     if(e != null) AssignedEngineers.Remove(e);
 }
Exemplo n.º 5
0
 public void AddEngineer(Engineer e)
 {
     if(e != null) AssignedEngineers.Add(e);
 }
 public List<Task> GetTaskList(Engineer e)
 {
     return InitialTask.GetTaskList(e);
 }