forked from nus-cs2103-AY1920S1/addressbook-level3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skeleton classes for generate interview timetable feature (#50)
* Add skeleton classes for generate interview timetable feature * Fix errors with continous integration * Add Unit Tests for Row, Column, and Schedule class * Fix checkstyle issue
- Loading branch information
1 parent
f266710
commit 9fe0c7e
Showing
6 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")); | ||
} | ||
} |