package seedu.testplanner.testutil;

import seedu.dailyplanner.model.tag.Tag;
import seedu.dailyplanner.model.tag.UniqueTagList;
import seedu.dailyplanner.model.tag.UniqueTagList.DuplicateTagException;
import seedu.dailyplanner.model.task.*;

/**
 * A mutable person object. For testing only.
 */
public class TestTask implements ReadOnlyTask {

	private String name;
	private DateTime start;
	private DateTime end;
	private boolean isComplete;
	private boolean isPinned;
	private UniqueTagList tags;

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

	public void setName(String name) {
		this.name = name;
	}

	public void setStart(DateTime start) {
		this.start = start;
	}

	public void setEnd(DateTime end) {
		this.end = end;
	}

	public void setCompletion(boolean completeStatus) {
		this.isComplete = completeStatus;
	}

	@Override
	public void markAsComplete() {
		isComplete = true;
	}

	@Override
	public void markAsNotComplete() {
		isComplete = false;
	}

	public void setPin(boolean pinStatus) {
		this.isPinned = pinStatus;
	}

	@Override
	public void pin() {
		isPinned = true;
	}

	@Override
	public void unpin() {
		isPinned = false;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public DateTime getStart() {
		return start;
	}

	@Override
	public DateTime getEnd() {
		return end;
	}

	@Override
	public boolean isComplete() {
		return isComplete;
	}

	@Override
	public String getCompletion() {
		return (isComplete) ? "COMPLETE" : "NOT COMPLETE";
	}

	@Override
	public boolean isPinned() {
		return isPinned;
	}

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

	@Override
	public String getDueStatus() {
		return Task.calculateDueStatus(end);
	}

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

	// @@author A0146749N
	public String getAddCommand() {
		StringBuilder sb = new StringBuilder();
		sb.append("add " + this.getName());
		if (!this.getStart().toString().equals(""))
			sb.append(" s/" + this.getStart().toString());
		if (!this.getEnd().toString().equals(""))
			sb.append(" e/" + this.getEnd().toString());
		if (!this.getTags().toSet().isEmpty())
			this.getTags().getInternalList().stream().forEach(s -> sb.append(" c/" + s.tagName));
		return sb.toString();
	}
}

@@ -1714,74 +1714,12 @@
 %09%7D%0A%0A
-%09@Override%0A%09public String toString() %7B%0A%09%09return getAsText();%0A%09%7D%0A%0A%09
+    
 // @
@@ -1736,17 +1736,20 @@
 146749N%0A
-%09
+    
 public S
@@ -1772,18 +1772,24 @@
 and() %7B%0A
-%09%09
+        
 StringBu
@@ -1820,18 +1820,24 @@
 lder();%0A
-%09%09
+        
 sb.appen
@@ -1860,26 +1860,32 @@
 getName());%0A
-%09%09
+        
 if (!this.ge
@@ -1908,35 +1908,44 @@
 g().equals(%22%22))%0A
-%09%09%09
+            
 sb.append(%22 s/%22 
@@ -1967,34 +1967,40 @@
 ().toString());%0A
-%09%09
+        
 if (!this.getEnd
@@ -2025,19 +2025,28 @@
 ls(%22%22))%0A
-%09%09%09
+            
 sb.appen
@@ -2082,18 +2082,24 @@
 ing());%0A
-%09%09
+        
 if (!thi
@@ -2133,11 +2133,20 @@
 ())%0A
-%09%09%09
+            
 this
@@ -2227,18 +2227,24 @@
 Name));%0A
-%09%09
+        
 return s
@@ -2257,13 +2257,273 @@
 ring();%0A
+    %7D%0A%0A    public Task asTask() %7B%0A        System.out.println(%22TestTask: %22 + name + start + end +isComplete + isPinned);%0A        return new Task(name, start, end, isComplete, isPinned, tags);%0A    %7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return getAsText();%0A
 %09%7D%0A
+%0A
 %7D%0A

Fix test case