package seedu.doist.testutil;

import java.util.Date;

import seedu.doist.commons.exceptions.IllegalValueException;
import seedu.doist.model.tag.Tag;
import seedu.doist.model.tag.UniqueTagList;
import seedu.doist.model.task.Description;
import seedu.doist.model.task.Priority;

/**
 *
 */
public class TaskBuilder {

    private TestTask task;

    public TaskBuilder() {
        this.task = new TestTask();
    }

    /**
     * Initializes the TaskBuilder with the data of {@code personToCopy}.
     */
    public TaskBuilder(TestTask taskToCopy) {
        this.task = new TestTask(taskToCopy);
    }

    public TaskBuilder withName(String name) throws IllegalValueException {
        this.task.setName(new Description(name));
        return this;
    }

    public TaskBuilder withPriority(String priority) throws IllegalValueException {
        this.task.setPriority(new Priority(priority));
        return this;
    }

    public TaskBuilder withTags(String ... tags) throws IllegalValueException {
        task.setTags(new UniqueTagList());
        for (String tag: tags) {
            task.getTags().add(new Tag(tag));
        }
        return this;
    }

    public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException {
        this.task.setStartDate(startDate);
        this.task.setEndDate(endDate);
        return this;
    }

    public TestTask build() {
        return this.task;
    }

}

@@ -1270,16 +1270,27 @@
 is.task.
+getDates().
 setStart
@@ -1324,16 +1324,27 @@
 is.task.
+getDates().
 setEndDa

Change class to use new TaskDate