private static void SetupTaskList(TaskList tasks) { Task firstTask = tasks.AddTask("New Task"); Task secondTask = tasks.AddTask("Another Task"); tasks.CompleteTask(firstTask.TaskId); }
public void CompleteTaskShouldReturnNullIfTaskIdIsNonexistent() { TaskList tasks = new TaskList(); Task returnedTask = tasks.CompleteTask(42); Assert.IsNull(returnedTask, string.Format("Returned task should be null, not {0}", returnedTask)); }
// TODO check if other is player private void OnTriggerEnter(Collider other) { if (renderer.enabled) { TaskList.CompleteTask(this.taskID, true); Score.AddToScore(pointsWorth); StopCoroutine(current); renderer.enabled = false; } }
public void CompleteTaskShouldMarkTaskComplete() { TaskList tasks = new TaskList(); Task newTask = tasks.AddTask("Task to complete"); Assert.IsNull(newTask.CompletionDate, "Tasks should not be completed when they are first added."); tasks.CompleteTask(newTask.TaskId); Assert.IsNotNull(newTask.CompletionDate, "Completing a task needs to add a completion date."); Assert.AreEqual <DateTime>(DateTime.Today, newTask.CompletionDate.Value, "Completion date should be today."); }
public override void Action(GameObject player) { TaskList taskList = player.GetComponent <TaskList>(); taskList.CompleteTask(task); }