public void Accept_With_Parent() { #region preparation Task task = new Task { Project = get_project() }; Task brother = new Task { Project = get_project() }; Task parent = new Task { IsVirtual = true, Project = get_project() }; parent.AddChild(task); parent.AddChild(brother); TaskQuality Quality = TaskQuality.Good; #endregion #region only the brother is accept, not affect parent brother.Accept(Quality); brother.has_accept(Quality); Assert.That(parent.CurrentStatus, Is.Not.EqualTo(Status.Accept)); #endregion #region both the brother and task are accepted, affect their parent now task.Accept(Quality); task.AutoAcceptAncestors(); task.has_accept(Quality); parent.has_accept(Constants.CommentAutoAcceptForChildren); Assert.That(parent.Quality, Is.Null); #endregion }
private static void set_task_status(Task task, Status status) { switch (status) { case Status.Assign: task.Assign(); break; case Status.Remove: task.Remove(); break; case Status.BeginWork: task.Assign(); task.BeginWork(); break; case Status.Complete: task.Assign(); task.BeginWork(); task.Complete(); break; case Status.Accept: task.Assign(); task.BeginWork(); task.Complete(); task.Accept(null); break; } }
public void Accept() { Task task = new Task { Owner = new User(), Accepter = new User() }; task.BeginWork(); task.Complete(); task.Accept(TaskQuality.Good); task.has_accept(TaskQuality.Good); }