package seedu.address.testutil;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;

/**
 *
 */
public class ItemBuilder {

    private TestItem person;

    public ItemBuilder() {
        this.person = new TestItem();
    }

    public ItemBuilder withItemType(String itemType) throws IllegalValueException {
        this.person.setItemType(new ItemType(itemType));
        return this;
    }

    public ItemBuilder withTags(String ... tags) throws IllegalValueException {
        for (String tag: tags) {
            person.getTags().add(new Tag(tag));
        }
        return this;
    }

    public ItemBuilder withEndDate(String endDate) throws IllegalValueException {
        this.person.setEndDate(new Date(endDate));
        return this;
    }
    
    public ItemBuilder withEndTime(String endTime) throws IllegalValueException {
        this.person.setEndTime(new Time(endTime));
        return this;
    }

    public ItemBuilder withName(String name) throws IllegalValueException {
        this.person.setName(new Name(name));
        return this;
    }

    public ItemBuilder withStartDate(String startDate) throws IllegalValueException {
        this.person.setStartDate(new Date(startDate));
        return this;
    }
    
    public ItemBuilder withStartTime(String startTime) throws IllegalValueException {
        this.person.setStartTime(new Time(startTime));
        return this;
    }

    public TestItem build() {
        return this.person;
    }

}

@@ -221,22 +221,20 @@
 estItem 
-person
+item
 ;%0A%0A    p
@@ -268,22 +268,20 @@
    this.
-person
+item
  = new T
@@ -391,30 +391,28 @@
        this.
-person
+item
 .setItemType
@@ -590,22 +590,20 @@
         
-person
+item
 .getTags
@@ -753,30 +753,28 @@
        this.
-person
+item
 .setEndDate(
@@ -916,30 +916,28 @@
        this.
-person
+item
 .setEndTime(
@@ -1069,30 +1069,28 @@
        this.
-person
+item
 .setName(new
@@ -1222,38 +1222,36 @@
  %7B%0A        this.
-person
+item
 .setStartDate(ne
@@ -1401,22 +1401,20 @@
    this.
-person
+item
 .setStar
@@ -1523,14 +1523,12 @@
 his.
-person
+item
 ;%0A  

Rename person to item in TestItem class