forked from nus-cs2113-AY2324S1/tp
-
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.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/test/java/seedu/cafectrl/command/NextDayCommandTest.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,34 @@ | ||
package seedu.cafectrl.command; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seedu.cafectrl.data.CurrentDate; | ||
import seedu.cafectrl.data.Sales; | ||
import seedu.cafectrl.ui.Ui; | ||
|
||
class NextDayCommandTest { | ||
@Test | ||
public void execute_oneNextDay_expectDayTwo() { | ||
Ui ui = new Ui(); | ||
Sales sales = new Sales(); | ||
CurrentDate currentDate = new CurrentDate(sales); | ||
Command nextDayCommand = new NextDayCommand(ui, sales, currentDate); | ||
nextDayCommand.execute(); | ||
int actualDay = currentDate.getCurrentDay() + 1; | ||
int expectedDay = 2; | ||
assert actualDay == expectedDay; | ||
} | ||
|
||
@Test | ||
public void execute_nineNextDay_expectDayTen() { | ||
Ui ui = new Ui(); | ||
Sales sales = new Sales(); | ||
CurrentDate currentDate = new CurrentDate(sales); | ||
for (int i = 0; i < 9; i ++) { | ||
Command nextDayCommand = new NextDayCommand(ui, sales, currentDate); | ||
nextDayCommand.execute(); | ||
} | ||
int actualDay = currentDate.getCurrentDay() + 1; | ||
int expectedDay = 10; | ||
assert actualDay == expectedDay; | ||
} | ||
} |