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.
- Loading branch information
Showing
24 changed files
with
934 additions
and
222 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
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
38 changes: 0 additions & 38 deletions
38
src/test/java/seedu/address/logic/commands/AddCommandIntegrationTest.java
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
103 changes: 0 additions & 103 deletions
103
src/test/java/seedu/address/logic/commands/DeleteCommandTest.java
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
46 changes: 46 additions & 0 deletions
46
src/test/java/seedu/address/logic/commands/cardcommands/AddCommandIntegrationTest.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,46 @@ | ||
package seedu.address.logic.commands.cardcommands; | ||
|
||
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; | ||
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import seedu.address.commons.core.Messages; | ||
import seedu.address.model.Model; | ||
import seedu.address.model.ModelManager; | ||
import seedu.address.model.card.Card; | ||
import seedu.address.testutil.CardBuilder; | ||
|
||
/** | ||
* Contains integration tests (interaction with the Model) for {@code AddCommand}. | ||
*/ | ||
class AddCommandIntegrationTest { | ||
|
||
private Model model; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
model = new ModelManager(); | ||
} | ||
|
||
@Test | ||
void execute_newCard_success() { | ||
Card abra = new CardBuilder().withWord("Abra").build(); | ||
|
||
Model expectedModel = new ModelManager(); | ||
|
||
expectedModel.addCard(abra); | ||
|
||
assertCommandSuccess(new AddCommand(abra), model, | ||
String.format(AddCommand.MESSAGE_SUCCESS, abra), expectedModel); | ||
} | ||
|
||
|
||
@Test | ||
void execute_duplicateCard_throwsCommandException() { | ||
Card cardInList = model.getCurrentWordBank().getCardList().get(0); | ||
assertCommandFailure(new AddCommand(cardInList), model, Messages.MESSAGE_DUPLICATE_CARD); | ||
} | ||
|
||
} |
Oops, something went wrong.