/java/seedu/geekeep/testutil/TestTask.java
package seedu .geekeep .testutil ;
import seedu .geekeep .model .tag .UniqueTagList ;
import seedu .geekeep .model .task .DateTime ;
import seedu .geekeep .model .task .Description ;
import seedu .geekeep .model .task .ReadOnlyTask ;
import seedu .geekeep .model .task .Title ;
/**
* A mutable task object. For testing only.
*/
public class TestTask implements ReadOnlyTask {
private Title title ;
private Description description ;
private DateTime startDateTime ;
private DateTime endDateTime ;
private UniqueTagList tags ;
public TestTask () {
tags = new UniqueTagList ();
}
/**
* Creates a copy of {@code taskToCopy}.
*/
public TestTask (TestTask taskToCopy ) {
this .title = taskToCopy .getTitle ();
this .endDateTime = taskToCopy .getEndDateTime ();
this .startDateTime = taskToCopy .getStartDateTime ();
this .description = taskToCopy .getDescriptoin ();
this .tags = taskToCopy .getTags ();
}
public String getAddCommand () {
StringBuilder sb = new StringBuilder ();
sb .append ("add " + this .getTitle ().title + " " );
sb .append ("d/" + this .getDescriptoin ().value + " " );
sb .append ("e/" + this .getEndDateTime ().value + " " );
sb .append ("s/" + this .getStartDateTime ().value + " " );
this .getTags ().asObservableList ().stream ().forEach (s -> sb .append ("t/" + s .tagName + " " ));
return sb .toString ();
}