forked from nus-cs2103-AY1920S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds testcases for export and import commands (#155)
* Import from excel function * Adds implementation for ExcelReader * debug importExcel classes * Check style for Import branch * Reads csv file correctly * Finished up import interviewers feature * Integrated with Schedule class and removed ScheduleStub * Handles import exceptions * Corrected Styling * Adds test for Import commands * Corrects styling for Import Tests * Rename ExcelReader to CsvReader * handles exceptions for import interviewers * Adds intervieweesList attribute to model * Travis fix * Travis fix * Style fix * UML Diagrams * Update Developer's Guide * Resized diagrams * Resize diagrams * Style fix * Fixed styling issues in devdocs * Updates import interviewer's feature * Fix JSON parsing error * Use a factory method instead to allow for IllegalArgumentException * Import interviewee's data feature completed * Fixed bugs * Implements generateEmptyScheduleList feature * Commit to pull * Fix styling issues * Fix styling issues * Implement listener to Schedule data change * Fix travis issue * Fix bug in refreshing schedule * Merged updated refreshlistener * Updates user guide * Update ImportCommand.java * Add catch for exception for import command * Update ImportCommand.java * Added assertions * Removes some bugs and updates userguide * Fix style * Adds test cases for import command and model manager * Small change to remove whitespace * Implements csv writer * Refactors import command to use prefix format * Updates Export Command * Completes implementation of Export Command * Updates userguide and debug tests * Check style * Added tests for Export and Import commands * Style check * Fixed testcases * Fix testcases
- Loading branch information
Showing
15 changed files
with
274 additions
and
8 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
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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/seedu/scheduler/logic/parser/ExportCommandParser.java
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
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
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
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
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,9 @@ | ||
10/09/2019,Welfare - Hazel,Technical - Johnathan,Publicity - Lucia | ||
18:00-18:30,John,Steven,0 | ||
18:30-19:00,Alex,Clark,John | ||
19:00-19:30,Alicia,0,charlie | ||
19:30-20:00,Charlie,0,Selina | ||
20:00-20:30,Selina,0,0 | ||
20:30-21:00,Natal,0,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
31 changes: 31 additions & 0 deletions
31
src/test/java/seedu/scheduler/logic/commands/ExportCommandTest.java
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,31 @@ | ||
package seedu.scheduler.logic.commands; | ||
|
||
import static seedu.scheduler.logic.commands.CommandTestUtil.assertCommandFailure; | ||
import static seedu.scheduler.logic.commands.CommandTestUtil.assertCommandSuccess; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import seedu.scheduler.model.FilePath; | ||
import seedu.scheduler.model.Model; | ||
import seedu.scheduler.model.ModelManager; | ||
|
||
|
||
public class ExportCommandTest { | ||
public static final String DESTINATION_FILE = "src/test/data/ImportsTest/storage.csv"; | ||
private static Model model = new ModelManager(); | ||
|
||
@Test | ||
public void execute_exportCommand_success() { | ||
ExportCommand exportCommand = new ExportCommand(new FilePath(DESTINATION_FILE)); | ||
CommandResult expectedCommandResult = new CommandResult(ExportCommand.SUCCESS_MESSAGE, false, false); | ||
model.setScheduled(true); | ||
assertCommandSuccess(exportCommand, model, expectedCommandResult, model); | ||
} | ||
|
||
@Test | ||
public void execute_exportCommand_throwsCommandException() { | ||
ExportCommand exportCommand = new ExportCommand(new FilePath(DESTINATION_FILE)); | ||
model.setScheduled(false); | ||
assertCommandFailure(exportCommand, model, ExportCommand.NOT_SCHEDULED_ERROR); | ||
} | ||
} |
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
Oops, something went wrong.