diff --git a/GazeeeboLogger.log.lck b/GazeeeboLogger.log.lck deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Save.txt b/Save.txt index 504f615c6f..cb7be37ecd 100644 --- a/Save.txt +++ b/Save.txt @@ -1,21 +1 @@ D|ND|yearly assignment|by: 2020-01-01 01:01:01 -E|ND|party|at: 2019-11-09 12:00:00-14:00:00 -E|ND|project meeting|at: 2019-01-13 08:00:00-13:00:00 -E|ND|meeting friend|at: 2019-01-13 15:00:00-16:00:00 -E|ND|welfare pack collection|at: 2019-01-13 16:30:00-17:30:00 -E|ND|internship fair|at: 2019-01-13 18:00:00-20:30:00 -D|ND|project submission|by: 2019-01-13 23:59:59 -D|ND|PPP|by: 2019-01-13 23:59:59 -D|ND|UG|by: 2019-01-13 23:59:59 -D|ND|DG|by: 2019-01-13 23:59:59 -D|ND|jar file submission|by: 2019-01-13 23:59:59 -D|ND|update github page|by: 2019-01-13 23:59:59 -E|ND|lunch with parents|at: 2019-01-12 12:00:00-13:00:00 -E|ND|consultation|at: 2019-01-11 14:00:00-14:30:00 -P|ND|watch cg2028 webcast|2019-01-10 and 2019-01-14 -P|ND|do geh1036 tutorial|2019-01-09 and 2019-01-13 -P|ND|polish my blade|2019-01-07 and 2019-01-09 -P|ND|cut hair|2019-01-06 and 2019-01-07 -P|ND|buy new chair|2019-01-05 and 2019-01-08 -P|ND|clean room|2019-01-06 and 2019-01-10 - diff --git a/docs/team/jessteoxizhi.pdf b/docs/team/jessteoxizhi.pdf index b5ae6fd5c8..ee7c779e6e 100644 Binary files a/docs/team/jessteoxizhi.pdf and b/docs/team/jessteoxizhi.pdf differ diff --git a/src/main/resources/NoteDaily.txt b/src/main/resources/NoteDaily.txt index e69de29bb2..e9af979d7d 100644 --- a/src/main/resources/NoteDaily.txt +++ b/src/main/resources/NoteDaily.txt @@ -0,0 +1,22 @@ +2019-10-12 +1 +testing note +2020-09-11 +2 +note 1 +note 2 +2019-08-11 +1 +updated note +2019-11-09 +10 +will receive chocolate hahaha +jiayou for this busy day +today is a holiday +made a new friend today :) +managed meet mum +went to botanic gardens +saw a new species of bird +took photo of a rare bird +ai ya! failed to photograph a pretty butterfly +found a pretty pebble diff --git a/src/test/java/PlacesCommandTest/PlacesAddCommandTest.java b/src/test/java/placestest/PlacesAddCommandTest.java similarity index 98% rename from src/test/java/PlacesCommandTest/PlacesAddCommandTest.java rename to src/test/java/placestest/PlacesAddCommandTest.java index f0e3d55963..1a5263a13f 100644 --- a/src/test/java/PlacesCommandTest/PlacesAddCommandTest.java +++ b/src/test/java/placestest/PlacesAddCommandTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.ui.Ui; import gazeeebo.commands.places.AddPlacesCommand; @@ -59,3 +59,4 @@ void testAddWrongPlacesCommand() { assertEquals("Please input add command in the correct format\r\n", output.toString()); } } + diff --git a/src/test/java/PlacesCommandTest/PlacesDeleteCommandTest.java b/src/test/java/placestest/PlacesDeleteCommandTest.java similarity index 98% rename from src/test/java/PlacesCommandTest/PlacesDeleteCommandTest.java rename to src/test/java/placestest/PlacesDeleteCommandTest.java index 3544378e62..6a69029e6e 100644 --- a/src/test/java/PlacesCommandTest/PlacesDeleteCommandTest.java +++ b/src/test/java/placestest/PlacesDeleteCommandTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.ui.Ui; import gazeeebo.commands.places.DeletePlacesCommand; @@ -71,3 +71,4 @@ void testDeleteWrongFormatPlacesCommand() throws IOException { assertEquals("Please input delete command in the correct format\r\n", output.toString()); } } + diff --git a/src/test/java/PlacesCommandTest/PlacesFindCommandTest.java b/src/test/java/placestest/PlacesFindCommandTest.java similarity index 96% rename from src/test/java/PlacesCommandTest/PlacesFindCommandTest.java rename to src/test/java/placestest/PlacesFindCommandTest.java index 04e4ca841f..ff5f03d930 100644 --- a/src/test/java/PlacesCommandTest/PlacesFindCommandTest.java +++ b/src/test/java/placestest/PlacesFindCommandTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.ui.Ui; import gazeeebo.commands.places.FindPlacesCommand; @@ -37,7 +37,7 @@ void restoreStream() { } /** - * test find places command + * test find places command. * @throws IOException exception when there is an error reading the command */ @@ -53,3 +53,4 @@ void testFindPlacesCommand() throws IOException { + "------------------------------------------\n", output.toString()); } } + diff --git a/src/test/java/PlacesCommandTest/PlacesListCommandTest.java b/src/test/java/placestest/PlacesListCommandTest.java similarity index 95% rename from src/test/java/PlacesCommandTest/PlacesListCommandTest.java rename to src/test/java/placestest/PlacesListCommandTest.java index 7bdf62c12c..de04b2baff 100644 --- a/src/test/java/PlacesCommandTest/PlacesListCommandTest.java +++ b/src/test/java/placestest/PlacesListCommandTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.ui.Ui; import gazeeebo.commands.places.ListPlacesCommand; @@ -38,7 +38,7 @@ void restoreStream() { /** * test list command. - * @throws IOException + * @throws IOException Exception when file cannot be read */ @Test @@ -57,3 +57,4 @@ void testListPlacesCommand() throws IOException { + "------------------------------------------\n", output.toString()); } } + diff --git a/src/test/java/PlacesCommandTest/PlacesCommandParserTest.java b/src/test/java/placestest/PlacesParserTest.java similarity index 98% rename from src/test/java/PlacesCommandTest/PlacesCommandParserTest.java rename to src/test/java/placestest/PlacesParserTest.java index 595bfe58d0..2faeb2f407 100644 --- a/src/test/java/PlacesCommandTest/PlacesCommandParserTest.java +++ b/src/test/java/placestest/PlacesParserTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.storage.TriviaStorage; import gazeeebo.triviamanager.TriviaManager; @@ -21,7 +21,7 @@ import java.util.Stack; import static org.junit.jupiter.api.Assertions.assertEquals; -class PlacesCommandParserTest { +class PlacesParserTest { private ByteArrayOutputStream output = new ByteArrayOutputStream(); private PrintStream mine = new PrintStream(output); private PrintStream original = System.out; @@ -80,3 +80,4 @@ void testPlaceCommand() throws IOException, ParseException, DukeException { + "\r\n",output.toString()); } } + diff --git a/src/test/java/PlacesCommandTest/PlacesUndoCommandTest.java b/src/test/java/placestest/PlacesUndoCommandTest.java similarity index 92% rename from src/test/java/PlacesCommandTest/PlacesUndoCommandTest.java rename to src/test/java/placestest/PlacesUndoCommandTest.java index 83edfb5435..b2f8006c3f 100644 --- a/src/test/java/PlacesCommandTest/PlacesUndoCommandTest.java +++ b/src/test/java/placestest/PlacesUndoCommandTest.java @@ -1,6 +1,6 @@ //@@author jessteoxizhi -package PlacesCommandTest; +package placestest; import gazeeebo.ui.Ui; import gazeeebo.commands.places.UndoPlacesCommand; @@ -14,7 +14,12 @@ import java.io.IOException; import java.io.PrintStream; import java.text.ParseException; -import java.util.*; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import java.util.Stack; + + import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/studyAssistTest/deleteModuleCommandTest.java b/src/test/java/studyAssistTest/deleteModuleCommandTest.java index 342c23f41f..0a51cfac84 100644 --- a/src/test/java/studyAssistTest/deleteModuleCommandTest.java +++ b/src/test/java/studyAssistTest/deleteModuleCommandTest.java @@ -19,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class deleteModuleCommandTest { +class deleteModuleCommandTest { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private final PrintStream originalOut = System.out; @@ -32,19 +32,19 @@ public void setUpStreams() { public void restoreStreams() { System.setOut(originalOut); } + @Test void deleteModule_emptyException() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete"; try { - new DeleteModuleCommand().execute(StudyPlan,studyAssistPageStorage,ui,oldStudyPlan); -// fail(); - } catch (DukeException e){ + new DeleteModuleCommand().execute(studyPlan,studyAssistPageStorage,ui,oldStudyPlan); + } catch (DukeException e) { assertEquals("Please follow the correct input format~",e.getMessage()); } } @@ -54,105 +54,104 @@ void deleteModule_wrongModuleException() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete CD1234 from 5"; try { - new DeleteModuleCommand().execute(StudyPlan,studyAssistPageStorage,ui,oldStudyPlan); -// fail(); - } catch (DukeException e){ + new DeleteModuleCommand().execute(studyPlan,studyAssistPageStorage,ui,oldStudyPlan); + } catch (DukeException e) { assertEquals("We currently do not have this module.",e.getMessage()); } } + @Test void addModule_wrongSemesterException() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete CS2040C from 9"; try { - new DeleteModuleCommand().execute(StudyPlan,studyAssistPageStorage,ui,oldStudyPlan); -// fail(); - } catch (DukeException | IOException e){ + new DeleteModuleCommand().execute(studyPlan,studyAssistPageStorage,ui,oldStudyPlan); + } catch (DukeException | IOException e) { assertEquals("Please input correct Semester number.",e.getMessage()); } } + @Test void addModule_wrongFormatException() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete CS2040C from"; try { - new DeleteModuleCommand().execute(StudyPlan,studyAssistPageStorage,ui,oldStudyPlan); -// fail(); - } catch (DukeException | IOException e){ + new DeleteModuleCommand().execute(studyPlan,studyAssistPageStorage,ui,oldStudyPlan); + } catch (DukeException | IOException e) { assertEquals("Please follow the correct input format~",e.getMessage()); } } + @Test void addModule_not_existModuleException() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete CS3230 sem 5"; try { - new DeleteModuleCommand().execute(StudyPlan,studyAssistPageStorage,ui,oldStudyPlan); -// fail(); - } catch (DukeException | IOException e){ + new DeleteModuleCommand().execute(studyPlan,studyAssistPageStorage,ui,oldStudyPlan); + } catch (DukeException | IOException e) { assertEquals("This module is not inside the study plan",e.getMessage()); } } + @Test void deleteModuleTest() throws IOException { Storage storage = new Storage(); Ui ui = new Ui(); StudyAssistPageStorage studyAssistPageStorage = new StudyAssistPageStorage(); - StudyPlannerCommand StudyPlan = new StudyPlannerCommand(studyAssistPageStorage); + StudyPlannerCommand studyPlan = new StudyPlannerCommand(studyAssistPageStorage); Stack>> oldStudyPlan = new Stack<>(); - oldStudyPlan.push(StudyPlan.StudyPlan); + oldStudyPlan.push(studyPlan.StudyPlan); ui.fullCommand = "delete CS2040C from 5"; - String ModuleCode = "CS2040C"; - int Semester = Integer.parseInt(ui.fullCommand.split(" ")[3]) - 1; + String moduleCode = "CS2040C"; + int semester = Integer.parseInt(ui.fullCommand.split(" ")[3]) - 1; boolean flag = false; int semester_number = -1; - for(int i=0;i tasks = new ArrayList(); @@ -30,21 +30,21 @@ public void testExecuteSnooze() throws ParseException,IOException,DukeException{ Storage storage = new Storage(); TriviaStorage triviaStorage = new TriviaStorage(); TriviaManager triviaManager = new TriviaManager(triviaStorage); - Stack> CommandStack = new Stack<>(); + Stack> commandStack = new Stack<>(); ArrayList deletedTask = new ArrayList(); ui.fullCommand = "deadline return book /by 2008-07-07 03:03:03"; try { - deadlineCommand.execute(tasks,ui,storage, CommandStack, deletedTask,triviaManager); + deadlineCommand.execute(tasks,ui,storage, commandStack, deletedTask,triviaManager); } catch (DukeException dukeException) { dukeException.printStackTrace(); } ui.fullCommand = "reschedule 1"; - int index =0; - String Decription = tasks.get(index).description; - ui.fullCommand ="2019-09-18 05:05:05"; - Task RescheduledDeadline = new Deadline(Decription, ui.fullCommand); + int index = 0; + String description = tasks.get(index).description; + ui.fullCommand = "2019-09-18 05:05:05"; + Task rescheduledDeadline = new Deadline(description, ui.fullCommand); tasks.remove(index); - tasks.add(RescheduledDeadline); + tasks.add(rescheduledDeadline); assertEquals(tasks.get(0).toString(),"D|ND|return book |by: 2019-09-18 05:05:05"); diff --git a/src/test/java/taskcmdtest/SnoozeCommandTest.java b/src/test/java/taskcmdtest/SnoozeCommandTest.java index d3128283fd..760e3d4f99 100644 --- a/src/test/java/taskcmdtest/SnoozeCommandTest.java +++ b/src/test/java/taskcmdtest/SnoozeCommandTest.java @@ -33,25 +33,25 @@ public void testExecuteSnooze() throws IOException { Storage storage = new Storage(); TriviaStorage triviaStorage = new TriviaStorage(); TriviaManager triviaManager = new TriviaManager(triviaStorage); - Stack> CommandStack = new Stack<>(); + Stack> commandStack = new Stack<>(); ArrayList deletedTask = new ArrayList(); ui.fullCommand = "deadline return book /by 2008-07-07 03:03:03"; try { - deadlineCommand.execute(tasks,ui,storage, CommandStack, deletedTask,triviaManager); - } catch (DukeException | ParseException |IOException e) { + deadlineCommand.execute(tasks,ui,storage, commandStack, deletedTask,triviaManager); + } catch (DukeException | ParseException | IOException e) { e.printStackTrace(); } int index = 0; int year = 1; - int day =1; - int month =1; + int day = 1; + int month = 1; int hour = 1; - String Description = tasks.get(index).description; + String description = tasks.get(index).description; String date = tasks.get(index).toString().split("\\|")[3].substring(4); LocalDateTime newDate = LocalDateTime.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); newDate = newDate.plusYears(year).plusMonths(month).plusDays(day).plusHours(hour); - String newBy= newDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - Task snoozedDeadline = new Deadline(Description,newBy); + String newBy = newDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + Task snoozedDeadline = new Deadline(description,newBy); tasks.remove(index); tasks.add(snoozedDeadline); diff --git a/src/test/java/taskcmdtest/TentativeEventTest.java b/src/test/java/taskcmdtest/TentativeEventTest.java index 48ada1aac7..5e2898b0fd 100644 --- a/src/test/java/taskcmdtest/TentativeEventTest.java +++ b/src/test/java/taskcmdtest/TentativeEventTest.java @@ -20,18 +20,20 @@ public void testListFormat() { tentativetimes.add("2008-06-07 05:05:05-08:08:08"); tentativetimes.add("2007-03-02 04:04:04-10:10:10"); TentativeEvent newtentative = new TentativeEvent(description,tentativetimes); - String timeslots = "[TE]"+ "[" + newtentative.getStatusIcon() + "] "+description+"\n" ; + String timeslots = "[TE]" + "[" + newtentative.getStatusIcon() + "] " + description + "\n"; for (int i = 0; i < tentativetimes.size(); i++) { DateTimeFormatter fmtED = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter fmtET = DateTimeFormatter.ofPattern("HH:mm:ss"); String[] dateTime = tentativetimes.get(i).split(" "); String[] time = dateTime[1].split("-"); - String datestring = LocalDate.parse(dateTime[0], fmtED).format(DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)); - String output = datestring + " "+ LocalTime.parse(time[0], fmtET).format(fmtET) + "-" + LocalTime.parse(time[1], fmtET).format(fmtET) + ")"; - if(i==0){ - timeslots += "at "+output+"\n"; - }else{ - timeslots += "or "+output+"\n"; + String datestring = LocalDate.parse(dateTime[0], fmtED) + .format(DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)); + String output = datestring + " " + LocalTime.parse(time[0], fmtET).format(fmtET) + "-" + + LocalTime.parse(time[1], fmtET).format(fmtET) + ")"; + if (i == 0) { + timeslots += "at " + output + "\n"; + } else { + timeslots += "or " + output + "\n"; } } assertEquals(newtentative.listFormat(),timeslots);