package seedu.tasklist.testutil;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import seedu.tasklist.model.tag.UniqueTagList;
import seedu.tasklist.model.task.Comment;
import seedu.tasklist.model.task.Name;
import seedu.tasklist.model.task.Priority;
import seedu.tasklist.model.task.ReadOnlyEventTask;
import seedu.tasklist.model.task.ReadOnlyTask;
import seedu.tasklist.model.task.Status;

public class TestEventTask extends TestTask implements ReadOnlyEventTask {

    private Name name;
    private Comment comment;
    private Priority priority;
    private Status status;
    private UniqueTagList tags;
    private Date startDate;
    private Date endDate;
    public static final String TYPE = "event";

    public TestEventTask() {
        tags = new UniqueTagList();
    }

    /**
     * Creates a copy of {@code taskToCopy}.
     */
    public TestEventTask(TestEventTask taskToCopy) {
        this.name = taskToCopy.getName();
        this.comment = taskToCopy.getComment();
        this.priority = taskToCopy.getPriority();
        this.status = taskToCopy.getStatus();
        this.startDate = taskToCopy.getStartDate();
        this.endDate = taskToCopy.getEndDate();
        this.tags = taskToCopy.getTags();
    }
    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public Date getStartDate() {
        return this.startDate;
    }

    @Override
    public Date getEndDate() {
        return this.endDate;
    }

    @Override
    public void setName(Name name) {
        this.name = name;
    }

    @Override
    public Name getName() {
        return this.name;
    }

    @Override
    public void setComment(Comment comment) {
        this.comment = comment;
    }

    @Override
    public Comment getComment() {
        return this.comment;
    }

    @Override
    public UniqueTagList getTags() {
        return this.tags;
    }

    @Override
    public void setPriority(Priority priority) {
        this.priority = priority;
    }

    @Override
    public Priority getPriority() {
        return this.priority;
    }

    @Override
    public void setStatus(Status status) {
        this.status = status;
    }

    @Override
    public Status getStatus() {
        return this.status;
    }

    @Override
    public String getAddCommand() {
        StringBuilder sb = new StringBuilder();
        sb.append("add " + this.getName().fullName + " ");
        sb.append("d/" + this.getStartDate().toString() + " ");
        sb.append("to " + this.getEndDate().toString() + " ");
        sb.append("c/" + this.getComment().value + " ");
        sb.append("p/" + this.getPriority().value + " ");
        this.getTags().asObservableList().stream().forEach(s -> sb.append("t/" + s.tagName + " "));
        return sb.toString();
    }

    @Override
    public String toString() {
        return getAsText();
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
                .append(" From: ")
                .append(getStartDate())
                .append(" To: ")
                .append(getEndDate())
                .append(" Status: ")
                .append(getStatus())
                .append(" Priority ")
                .append(getPriority())
                .append(" Comment: ")
                .append(getComment())
                .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    @Override
    public boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other != null // this is first to avoid NPE below
                && other.getName().equals(this.getName()) // state checks here onwards
                && other.getComment().equals(this.getComment())
                && other.getPriority().equals(this.getPriority())
                && other.getStatus().equals(this.getStatus())
                && other.getTags().equals(this.getTags())
                && other.getType().equals(this.getType())
                && ((ReadOnlyEventTask) other).getStartDate().equals(this.getStartDate())
                && ((ReadOnlyEventTask) other).getEndDate().equals(this.getEndDate()));
    }

    @Override
    public void setTags(UniqueTagList replacement) {
        this.tags = replacement;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Override
    public String getStartDateString() {
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        return dateFormat.format(this.startDate);
    }

    @Override
    public String getEndDateString() {
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        return dateFormat.format(this.endDate);
    }
}

@@ -2495,32 +2495,260 @@
 StartDate().
-toString
+getMonth() + %22-%22 + this.getStartDate().getDay() + %22-%22%0A                + this.getStartDate().getYear() + %22 %22 + this.getStartDate().getHours() + %22:%22%0A                + this.getStartDate().getMinutes() + %22:%22 + this.getStartDate().getSeconds
 () + %22 %22);%0A 

Change the way Date object is parsed for typicalTestTasks to pass JUnit test case.