diff --git a/src/main/java/seedu/address/model/Column.java b/src/main/java/seedu/address/model/Column.java new file mode 100644 index 00000000000..2851cbbfed4 --- /dev/null +++ b/src/main/java/seedu/address/model/Column.java @@ -0,0 +1,37 @@ +package seedu.address.model; + +import java.util.HashSet; + +import seedu.address.model.person.Address; +import seedu.address.model.person.Email; +import seedu.address.model.person.Name; +import seedu.address.model.person.Person; +import seedu.address.model.person.Phone; + +/** + * Encapsulates a column in the schedule timetable. + */ +public class Column { + + public int getSize() { + return 0; + } + + // Change this to return Interviewee + public Person getInterviewer() { + return new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + } + + // Change this to return Interivewee instead later + public Person getInterviewee(int index) { + return new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + } + + // Change this to return Interivewee instead later + public Person getInterviewee(String timing) { + return new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + } +} diff --git a/src/main/java/seedu/address/model/Row.java b/src/main/java/seedu/address/model/Row.java new file mode 100644 index 00000000000..5c5f76aa3c8 --- /dev/null +++ b/src/main/java/seedu/address/model/Row.java @@ -0,0 +1,30 @@ +package seedu.address.model; + +import java.util.HashSet; + +import seedu.address.model.person.Address; +import seedu.address.model.person.Email; +import seedu.address.model.person.Name; +import seedu.address.model.person.Person; +import seedu.address.model.person.Phone; + +/** + * Encapsulates a row in the schedule timetable. + */ +public class Row { + private String timing; + + public int getSize() { + return 0; + } + + public String getTiming() { + return timing; + } + + // Change this to return Interivewee instead later + public Person getInterviewee(int index) { + return new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + } +} diff --git a/src/main/java/seedu/address/model/Schedule.java b/src/main/java/seedu/address/model/Schedule.java new file mode 100644 index 00000000000..8b08701bd11 --- /dev/null +++ b/src/main/java/seedu/address/model/Schedule.java @@ -0,0 +1,70 @@ +package seedu.address.model; + +/** + * Encapsulates the schedule timetable in memory. + */ +public class Schedule { + private String date; + + /** + * Returns the first row of table. + * @return the first row of table. + */ + public Row getFirstRow() { + return new Row(); + } + + /** + * Returns a row in the table. + * @param index the index of the row in the table. + * @return a row in the table. + */ + public Row getRow(int index) { + return new Row(); + } + + /** + * Returns a row in the table with the timing given + * @param timing timing of the row. + * @return a row in the table with the timing given + */ + public Row getRow(String timing) { + return new Row(); + } + + /** + * Returns a column in the table. + * @param index index of the column in the table. + * @return a column in the table. + */ + public Column getColumn(int index) { + return new Column(); + } + + /** + * Returns a column in the table with the interviewer's description given. + * @param interviewerDesc the title of the column, which is the interviewer's description. + * @return a column in the table with the interviewer's description given. + */ + public Column getColumn(String interviewerDesc) { + return new Column(); + } + + /** + * Deletes a column in the table with the index given. + * @param index the index of the column in the table. + * @return the deleted column in the table with the index given. + */ + public Column deleteColumn(int index) { + return new Column(); + } + + /** + * Deletes a column in the table with the interviewer's description given. + * @param interviewerDesc the title of the column, which is the interviewer's description. + * @return the deleted column in the table with the interviewer's description given. + */ + public Column deleteColumn(String interviewerDesc) { + return new Column(); + } +} diff --git a/src/test/java/seedu/address/model/ColumnTest.java b/src/test/java/seedu/address/model/ColumnTest.java new file mode 100644 index 00000000000..d7537c456e7 --- /dev/null +++ b/src/test/java/seedu/address/model/ColumnTest.java @@ -0,0 +1,44 @@ +package seedu.address.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.HashSet; + +import org.junit.jupiter.api.Test; + +import seedu.address.model.person.Address; +import seedu.address.model.person.Email; +import seedu.address.model.person.Name; +import seedu.address.model.person.Person; +import seedu.address.model.person.Phone; + +public class ColumnTest { + @Test + public void getSize_skeleton_true() { + assertEquals(0, new Column().getSize()); + } + + // Change this to return Interviewee + @Test + public void getInterviewer_skeleton_true() { + Person person = new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + assertEquals(person, new Column().getInterviewer()); + } + + // Change this to return Interivewee instead later + @Test + public void getInterviewee_indexSkeleton_true() { + Person person = new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + assertEquals(person, new Column().getInterviewee(0)); + } + + // Change this to return Interivewee instead later + @Test + public void getInterviewee_timingSkeleton_true() { + Person person = new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + assertEquals(person, new Column().getInterviewee("26/10/2019 6:00pm-6:30pm")); + } +} diff --git a/src/test/java/seedu/address/model/RowTest.java b/src/test/java/seedu/address/model/RowTest.java new file mode 100644 index 00000000000..0b098865326 --- /dev/null +++ b/src/test/java/seedu/address/model/RowTest.java @@ -0,0 +1,36 @@ +package seedu.address.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.HashSet; + +import org.junit.jupiter.api.Test; + +import seedu.address.model.person.Address; +import seedu.address.model.person.Email; +import seedu.address.model.person.Name; +import seedu.address.model.person.Person; +import seedu.address.model.person.Phone; + +/** + * Skeleton for RowTest class + */ +public class RowTest { + @Test + public void getSize_skeleton_true() { + assertEquals(0, new Row().getSize()); + } + + @Test + public void getTiming_skeleton_true() { + assertNull(new Row().getTiming()); + } + + @Test + public void getInterviewee_skeleton_true() { + Person person = new Person(new Name("John Doe"), new Phone("12345678"), new Email("johndoe@mail.com"), + new Address("Singapore"), new HashSet<>()); + assertEquals(person, new Row().getInterviewee(0)); + } +} diff --git a/src/test/java/seedu/address/model/ScheduleTest.java b/src/test/java/seedu/address/model/ScheduleTest.java new file mode 100644 index 00000000000..c49b086fea0 --- /dev/null +++ b/src/test/java/seedu/address/model/ScheduleTest.java @@ -0,0 +1,43 @@ +package seedu.address.model; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; + +public class ScheduleTest { + + @Test + public void getFirstRow_skeleton_true() { + assertNotNull(new Schedule().getFirstRow()); + } + + @Test + public void getRow_indexSkeleton_true() { + assertNotNull(new Schedule().getRow(0)); + } + + @Test + public void getRow_timingSkeleton_true() { + assertNotNull(new Schedule().getRow("26/10/2019 6:00pm-6:30pm")); + } + + @Test + public void getColumn_indexSkeleton_true() { + assertNotNull(new Schedule().getColumn(0)); + } + + @Test + public void getColumn_interviewerDescSkeleton_true() { + assertNotNull(new Schedule().getColumn("26/10/2019 6:00pm-6:30pm")); + } + + @Test + public void deleteColumn_indexSkeleton_true() { + assertNotNull(new Schedule().deleteColumn(0)); + } + + @Test + public void deleteColumn_interviewerDescSkeleton_true() { + assertNotNull(new Schedule().deleteColumn("26/10/2019 6:00pm-6:30pm")); + } +}