Date of the task is incorrect when duration is zero

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));

}
}
Hi,

Thank you for your inquiry and sharing details.

We have investigated the issue at our end. We are unable to observe the said issue. We have used your code snippet along with latest version of Aspose.Tasks for .NET. Screenshots of Visual Studio output window and MSP is attached for your reference.


Ikram,


Your test does not execute the recalculate method “project.Recalculate ();”.
Without invoking this method the problem is not displayed.
Can you check it please?

Hi,

Thank you for providing feedback. We have analyzed the issue and observe the problem. It is logged under Id: TASKSNET-1963 for further investigation by the product team. You will be automatically notified once any update is received in this regard.