Skip to content

Commit

Permalink
Add skeleton classes for generate interview timetable feature (#50)
Browse files Browse the repository at this point in the history
* 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
ChrisKheng committed Oct 10, 2019
1 parent f266710 commit 9fe0c7e
Show file tree
Hide file tree
Showing 6 changed files with 260 additions and 0 deletions.
37 changes: 37 additions & 0 deletions 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<>());
}
}
30 changes: 30 additions & 0 deletions 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<>());
}
}
70 changes: 70 additions & 0 deletions 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();
}
}
44 changes: 44 additions & 0 deletions 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"));
}
}
36 changes: 36 additions & 0 deletions 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));
}
}
43 changes: 43 additions & 0 deletions 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"));
}
}

0 comments on commit 9fe0c7e

Please sign in to comment.