forked from nus-cs2103-AY1819S1/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2103-AY1819S1#68 from CS2103-AY1819S1-W12-2/…
…shaw_yeong_changes add AnalyticsCommandTest and update UML Diagrams
- Loading branch information
Showing
9 changed files
with
108 additions
and
4 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -21,3 +21,4 @@ out/ | |
allTest.sh | ||
tokens/ | ||
!_reposense/config.json | ||
#.profile# |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
81 changes: 81 additions & 0 deletions
81
src/test/java/seedu/address/logic/commands/AnalyticsCommandTest.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,81 @@ | ||
package seedu.address.logic.commands; | ||
|
||
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; | ||
import static seedu.address.testutil.TypicalTransactions.getUniqueFinancialDatabase; | ||
|
||
import org.junit.Test; | ||
|
||
import seedu.address.logic.CommandHistory; | ||
import seedu.address.model.Model; | ||
import seedu.address.model.ModelManager; | ||
import seedu.address.model.UserPrefs; | ||
import seedu.address.model.transaction.Deadline; | ||
|
||
|
||
public class AnalyticsCommandTest { | ||
private CommandHistory history = new CommandHistory(); | ||
private Model model = new ModelManager(); | ||
private Model expectedModel = new ModelManager(); | ||
private Model modelWithData = new ModelManager(getUniqueFinancialDatabase(), new UserPrefs()); | ||
private Model expectedModelWithData = new ModelManager(getUniqueFinancialDatabase(), new UserPrefs()); | ||
|
||
|
||
@Test | ||
public void execute_emptyFinancialListWithNoDate() { | ||
String expectedMessage = "Financial status : SGD 0.00"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(); | ||
assertCommandSuccess(analyticsCommand, model, history, expectedMessage, expectedModel); | ||
} | ||
|
||
@Test | ||
public void execute_emptyFinancialListWithDate_When_DatePassed_Then_TestWillFail() { | ||
String date = "12/12/2020"; | ||
Deadline checkDate = new Deadline(date); | ||
String expectedMessage = "Financial status : SGD 0.00"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(checkDate); | ||
assertCommandSuccess(analyticsCommand, model, history, expectedMessage, expectedModel); | ||
} | ||
|
||
@Test | ||
public void execute_non_emptyFinancialListWithNoDate() { | ||
String expectedMessage = "Financial status : SGD 188.10"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(); | ||
assertCommandSuccess(analyticsCommand, modelWithData, history, expectedMessage, expectedModelWithData); | ||
} | ||
|
||
@Test | ||
public void execute_non_emptyFinancialListWithDate_When_DatePassed_Then_TestWillFail() { | ||
String date = "11/11/2018"; | ||
Deadline checkDate = new Deadline(date); | ||
String expectedMessage = "Financial status : SGD 0.00"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(checkDate); | ||
assertCommandSuccess(analyticsCommand, modelWithData, history, expectedMessage, expectedModelWithData); | ||
} | ||
|
||
@Test | ||
public void execute_non_emptyFinancialListWithDateTest2_When_DatePassed_Then_TestWillFail() { | ||
String date = "12/11/2018"; | ||
Deadline checkDate = new Deadline(date); | ||
String expectedMessage = "Financial status : SGD 85.00"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(checkDate); | ||
assertCommandSuccess(analyticsCommand, modelWithData, history, expectedMessage, expectedModelWithData); | ||
} | ||
|
||
@Test | ||
public void execute_non_emptyFinancialListWithDateTest3_When_DatePassed_Then_TestWillFail() { | ||
String date = "18/11/2018"; | ||
Deadline checkDate = new Deadline(date); | ||
String expectedMessage = "Financial status : SGD 230.60"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(checkDate); | ||
assertCommandSuccess(analyticsCommand, modelWithData, history, expectedMessage, expectedModelWithData); | ||
} | ||
|
||
@Test | ||
public void execute_non_emptyFinancialListWithDateTest4_When_DatePassed_Then_TestWillFail() { | ||
String date = "12/12/2018"; | ||
Deadline checkDate = new Deadline(date); | ||
String expectedMessage = "Financial status : SGD 188.10"; | ||
AnalyticsCommand analyticsCommand = new AnalyticsCommand(checkDate); | ||
assertCommandSuccess(analyticsCommand, modelWithData, history, expectedMessage, expectedModelWithData); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -50,6 +50,8 @@ public class TypicalPersons { | |
.withEmail("[email protected]").withAddress("little india").build(); | ||
public static final Person IDA = new PersonBuilder().withName("Ida Mueller").withPhone("8482131") | ||
.withEmail("[email protected]").withAddress("chicago ave").build(); | ||
public static final Person JACK = new PersonBuilder().withName("JACK lee").withPhone("8402424") | ||
.withEmail("[email protected]").withAddress("chinatown").build(); | ||
|
||
// Manually added - Person's details found in {@code CommandTestUtil} | ||
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY) | ||
|
@@ -58,6 +60,8 @@ public class TypicalPersons { | |
.withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND) | ||
.build(); | ||
|
||
|
||
|
||
public static final String KEYWORD_MATCHING_MEIER = "Meier"; // A keyword that matches MEIER | ||
|
||
private TypicalPersons() {} // prevents instantiation | ||
|
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