Exemplo n.º 1
0
  /*
   * This is a case for the reading from a file with empty locations partition
   */
  @Test
  public void testReadEmptyLocation() throws IOException {
    Display emptyDescriptionDisplay = storage.getDisplay(FILE_TEST_EMPTY_LOCATION);

    ArrayList<TaskFloat> emptyFloat = emptyDescriptionDisplay.getFloatTasks();
    ArrayList<TaskDeadline> emptyDeadline = emptyDescriptionDisplay.getDeadlineTasks();
    ArrayList<TaskEvent> emptyEvent = emptyDescriptionDisplay.getEventTasks();

    assertEquals(null, emptyFloat.get(0).getLocation());
    assertEquals(null, emptyDeadline.get(0).getLocation());
    assertEquals(null, emptyEvent.get(0).getLocation());
  }
Exemplo n.º 2
0
  /* This is a case for the reading from a file with empty tags partition */
  @Test
  public void testReadEmptyTags() throws IOException {
    Display emptyDescriptionDisplay = storage.getDisplay(FILE_TEST_EMPTY_TAGS);

    ArrayList<TaskFloat> emptyFloat = emptyDescriptionDisplay.getFloatTasks();
    ArrayList<TaskDeadline> emptyDeadline = emptyDescriptionDisplay.getDeadlineTasks();
    ArrayList<TaskEvent> emptyEvent = emptyDescriptionDisplay.getEventTasks();

    ArrayList<Task> emptyTagList = new ArrayList<Task>();

    assertEquals(emptyTagList, emptyFloat.get(0).getTags());
    assertEquals(emptyTagList, emptyDeadline.get(0).getTags());
    assertEquals(emptyTagList, emptyEvent.get(0).getTags());
  }
Exemplo n.º 3
0
 /* This is a case for the normal reading from file partition */
 @Test
 public void testSaveAndRead() throws IOException {
   storage.saveFile(display);
   assertEquals(display.toString(), storage.getDisplay(FILE_TEST).toString());
 }
Exemplo n.º 4
0
 /* This is a case for the reading from a file with empty dates partition */
 @Test
 public void testReadEmptyDates() throws IOException {
   Display emptyDescriptionDisplay = storage.getDisplay(FILE_TEST_EMPTY_DATES);
   ArrayList<TaskEvent> emptyEvent = emptyDescriptionDisplay.getEventTasks();
   assertTrue(emptyEvent.isEmpty());
 }
Exemplo n.º 5
0
 /*
  * This is a case for the reading from a file with empty deadlines partition
  */
 @Test
 public void testReadEmptyDeadline() throws IOException {
   Display emptyDescriptionDisplay = storage.getDisplay(FILE_TEST_EMPTY_DEADLINE);
   ArrayList<TaskDeadline> emptyDeadline = emptyDescriptionDisplay.getDeadlineTasks();
   assertTrue(emptyDeadline.isEmpty());
 }