package seedu.jimi.testutil;

import seedu.jimi.model.tag.UniqueTagList;
import seedu.jimi.model.task.*;

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

    private Name name;
    private UniqueTagList tags;

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

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

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


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

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

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

    @Override
    public boolean isCompleted() {
        return false;
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
               .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    @Override
    public boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other instanceof TestFloatingTask // instanceof handles nulls
                && (other).getName().equals(this.getName()) // state checks here onwards
                && (other).isCompleted() == this.isCompleted()
                );

    }
}

package seedu.jimi.testutil;

import seedu.jimi.model.tag.UniqueTagList;
import seedu.jimi.model.task.*;

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

    private Name name;
    private UniqueTagList tags;
    private boolean isCompleted;

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

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

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


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

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

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

    public void setCompleted(boolean isCompleted) {
        this.isCompleted = isCompleted;
    }
    
    @Override
    public boolean isCompleted() {
        return false;
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
               .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    @Override
    public boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other instanceof TestFloatingTask // instanceof handles nulls
                && (other).getName().equals(this.getName()) // state checks here onwards
                && (other).isCompleted() == this.isCompleted()
                );

    }
}

Add isCompleted mem var to TestFloatingTask for testing