forked from nus-cs2113-AY2324S1/tp
-
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-cs2113-AY2324S1#6 from wendelinwemhoener/add-j…
…unit-tests Add JUnit tests for flashcards
- Loading branch information
Showing
4 changed files
with
26 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
package seedu.duke; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seedu.duke.flashcard.FlashcardComponent; | ||
|
||
import java.util.ArrayList; | ||
|
||
class DukeTest { | ||
@Test | ||
public void sampleTest() { | ||
assertTrue(true); | ||
} | ||
|
||
@Test | ||
public void testFlashcardComponent_isResponsible_notResponsible() { | ||
FlashcardComponent flashcardComponent = new FlashcardComponent( | ||
new ArrayList<>()); | ||
|
||
assertFalse(flashcardComponent.isResponsible("dfdfdfdfdf")); | ||
assertFalse(flashcardComponent.isResponsible("help me")); | ||
assertFalse(flashcardComponent.isResponsible(" ")); | ||
} | ||
|
||
@Test | ||
public void testFlashcardComponent_isResponsible_responsible() { | ||
FlashcardComponent flashcardComponent = new FlashcardComponent( | ||
new ArrayList<>()); | ||
|
||
assertTrue(flashcardComponent.isResponsible("create flashcard")); | ||
assertTrue(flashcardComponent.isResponsible("create flashcard ")); | ||
assertTrue(flashcardComponent.isResponsible("list flashcards")); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1 @@ | ||
Hello from | ||
____ _ | ||
| _ \ _ _| | _____ | ||
| | | | | | | |/ / _ \ | ||
| |_| | |_| | < __/ | ||
|____/ \__,_|_|\_\___| | ||
|
||
What is your name? | ||
Hello James Gosling | ||
Enter the front page text: |
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 |
---|---|---|
@@ -1 +1 @@ | ||
James Gosling | ||
create flashcard |