package tars.testutil;

import tars.model.task.*;
import tars.model.tag.UniqueTagList;

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

    private Name name;
    private Address address;
    private Email email;
    private Phone phone;
    private UniqueTagList tags;
    private DateTime dateTime;
    private Status status;
    private Priority priority;

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

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

    public void setAddress(Address address) {
        this.address = address;
    }

    public void setEmail(Email email) {
        this.email = email;
    }

    public void setPhone(Phone phone) {
        this.phone = phone;
    }

    @Override
    public Name getName() {
        return name;
    }
   
    @Override
    public DateTime getDateTime() {
        return dateTime;
    }

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

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

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

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

    public String getAddCommand() {
        StringBuilder sb = new StringBuilder();
        sb.append("add " + this.getName().taskName + " ");
        sb.append("p/" + this.getPhone().value + " ");
        sb.append("e/" + this.getEmail().value + " ");
        sb.append("a/" + this.getAddress().value + " ");
        this.getTags().getInternalList().stream().forEach(s -> sb.append("t/" + s.tagName + " "));
        return sb.toString();
    }
}

@@ -1416,10 +1416,12 @@
 nd(%22
-p/
+-dt 
 %22 + 
@@ -1432,76 +1432,29 @@
 .get
-Phone().value + %22 %22);%0A        sb.append(%22e/%22 + this.getEmail().value
+DateTime().toString()
  + %22
@@ -1481,10 +1481,11 @@
 nd(%22
-a/
+-p 
 %22 + 
@@ -1496,23 +1496,29 @@
 .get
-Address().value
+Priority().toString()
  + %22

Update getAddCommand() method