A task with duration equal to 0 and with predecessor and resource defined does not have the end date equal to the start date which causes unnecessary extension of the project in some situations.
Here’s the C # code to simulate the scenario:
[TestMethod]
public void Date_Of_The_Task_Is_Incorrect_When_Duration_Is_Zero()
{
using (var stream = ProjetoPadrao.Carregar())
{
var project = OpenProject(stream);
project.CalculationMode = CalculationMode.Automatic;
var task1 = project.RootTask.Children.Add(“T1”);
var task2 = project.RootTask.Children.Add(“T2”);
task1.Set(Tsk.Duration, project.GetDuration(1));
task2.Set(Tsk.Duration, project.GetDuration(0));
var link = project.TaskLinks.Add(task1, task2, TaskLinkType.FinishToStart);
project.CalculationMode = CalculationMode.None;
var resource1 = project.Resources.Add(“R1”);
project.ResourceAssignments.Add(task1, resource1);
project.ResourceAssignments.Add(task2, resource1);
Assert.IsTrue(task2.Get(Tsk.Start) == task2.Get(Tsk.Finish));
project.Recalculate();
Assert.IsTrue(task2.Get(Tsk.Start) == task2.Get(Tsk.Finish));
}
}