-
Notifications
You must be signed in to change notification settings - Fork 548
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
12 changed files
with
87 additions
and
87 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
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
40 changes: 0 additions & 40 deletions
40
src/test/java/seedu/address/model/tutorialgroup/GroupNameTest.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/test/java/seedu/address/model/tutorialgroup/GroupNumberTest.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,40 @@ | ||
package seedu.address.model.tutorialgroup; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static seedu.address.testutil.Assert.assertThrows; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
|
||
public class GroupNumberTest { | ||
|
||
@Test | ||
public void constructor_null_throwsNullPointerException() { | ||
assertThrows(NullPointerException.class, () -> new GroupNumber(null)); | ||
} | ||
|
||
@Test | ||
public void constructor_invalidName_throwsIllegalArgumentException() { | ||
String invalidGroupName = ""; | ||
assertThrows(IllegalArgumentException.class, () -> new GroupNumber(invalidGroupName)); | ||
} | ||
|
||
@Test | ||
public void isValidName() { | ||
// null group name | ||
assertThrows(NullPointerException.class, () -> GroupNumber.isValidGroupName(null)); | ||
|
||
// invalid group name | ||
assertFalse(GroupNumber.isValidGroupName("")); // empty string | ||
assertFalse(GroupNumber.isValidGroupName(" ")); // spaces only | ||
assertFalse(GroupNumber.isValidGroupName("^")); // only non-alphanumeric characters | ||
assertFalse(GroupNumber.isValidGroupName("peter*")); // contains non-alphanumeric characters | ||
assertFalse(GroupNumber.isValidGroupName("peter")); // contains alphabets | ||
assertFalse(GroupNumber.isValidGroupName("12")); // contains more than one digit | ||
|
||
// valid group name | ||
assertTrue(GroupNumber.isValidGroupName("1")); // alphabets only | ||
assertTrue(GroupNumber.isValidGroupName("2")); // numbers only | ||
} | ||
} |
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
Oops, something went wrong.