package seedu.doist.testutil;

import seedu.doist.model.tag.UniqueTagList;
import seedu.doist.model.task.Description;
import seedu.doist.model.task.Priority;
import seedu.doist.model.task.ReadOnlyTask;

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

    private Description name;
    private Priority priority;
    private UniqueTagList tags;

    public TestPerson() {
        tags = new UniqueTagList();
        priority = new Priority();
    }

    /**
     * Creates a copy of {@code personToCopy}.
     */
    public TestPerson(TestPerson personToCopy) {
        this.name = personToCopy.getDescription();
        this.priority = personToCopy.getPriority();
        this.tags = personToCopy.getTags();
    }

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

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

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

    @Override
    public Description getDescription() {
        return name;
    }

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

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

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

    public String getAddCommand() {
        StringBuilder sb = new StringBuilder();
        sb.append("add " + this.getDescription().desc + " ");
        this.getTags().asObservableList().stream().forEach(s -> sb.append("t/" + s.tagName + " "));
        return sb.toString();
    }
}

@@ -267,22 +267,20 @@
 ass Test
-Person
+Task
  impleme
@@ -408,22 +408,20 @@
 lic Test
-Person
+Task
 () %7B%0A   
@@ -577,32 +577,26 @@
 Test
-Person(TestPerson person
+Task(TestTask task
 ToCo
@@ -621,22 +621,20 @@
 .name = 
-person
+task
 ToCopy.g
@@ -674,22 +674,20 @@
 ority = 
-person
+task
 ToCopy.g
@@ -720,22 +720,20 @@
 .tags = 
-person
+task
 ToCopy.g
@@ -1466,16 +1466,95 @@
 + %22 %22);%0A
+        if (!this.getTags().isEmpty()) %7B%0A            sb.append(%22%5C%5Cunder%22);%0A    
         
@@ -1624,10 +1624,9 @@
 nd(%22
-t/
+ 
 %22 + 
@@ -1638,17 +1638,21 @@
 Name
- + %22 %22));
+));%0A        %7D
 %0A   

Modify TestTask to reflect Task model