Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluiexo authored and Pluiexo committed Mar 15, 2024
1 parent c2a4081 commit 01ee036
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/java/staffconnect/model/meeting/MeetDateTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MeetDateTime {


/**
* Constructs a {@code MeetDate}.
* Constructs a {@code MeetDateTime}.
*
* @param date A valid date.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/staffconnect/model/meeting/DescriptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public void constructor_invalidName_throwsIllegalArgumentException() {

@Test
public void isValidDescription() {
// null name
// null Description
assertThrows(NullPointerException.class, () -> Description.isValidDescription(null));

// invalid name
// invalid Description
assertFalse(Name.isValidName("")); // empty string
assertFalse(Name.isValidName(" ")); // spaces only
assertFalse(Name.isValidName("^")); // only non-alphanumeric characters
assertFalse(Name.isValidName("peter meeting*")); // contains non-alphanumeric characters

// valid name
// valid Description
assertTrue(Name.isValidName("meeting")); // alphabets only
assertTrue(Name.isValidName("12345")); // numbers only
assertTrue(Name.isValidName("meeting at for 2nd finals")); // alphanumeric characters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void isValidMeetDate() {
// null Date
assertThrows(NullPointerException.class, () -> MeetDateTime.isValidMeetDateTime(null));

// invalid Meeting Date code
// invalid Meeting Date
assertFalse(MeetDateTime.isValidMeetDateTime("")); // empty string
assertFalse(MeetDateTime.isValidMeetDateTime(" ")); // spaces only
assertFalse(MeetDateTime.isValidMeetDateTime("ABCD")); // letters only
Expand All @@ -40,7 +40,7 @@ public void isValidMeetDate() {
assertFalse(MeetDateTime.isValidMeetDateTime("12/4/2023 12:00")); // wrong number digits for month
assertFalse(MeetDateTime.isValidMeetDateTime("1/04/2023 12:00")); // wrong number digits for day

// valid module code
// valid meeting Date
assertTrue(MeetDateTime.isValidMeetDateTime("12/04/2023 12:00")); // dd/MM/yyyy HH:mm
assertTrue(MeetDateTime.isValidMeetDateTime("15/02/2024 12:00")); // dd/MM/yyyy HH:mm
}
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/staffconnect/model/meeting/MeetingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import org.junit.jupiter.api.Test;

class MeetingTest {
private static final Description testDescription = new Description("Valid description");
private static final MeetDateTime testDate = new MeetDateTime("12/04/2023 12:00");
private static final Description otherDescription = new Description("Another valid description");
private static final Description TEST_DESCRIPTION = new Description("Valid description");
private static final MeetDateTime TEST_DATE = new MeetDateTime("12/04/2023 12:00");
private static final Description TEST_OTHERDESCRIPTION = new Description("Another valid description");
private static final MeetDateTime otherDate = new MeetDateTime("13/04/2023 13:00");

@Test
public void equals() {

Meeting testMeeting = new Meeting(testDescription, testDate);
Meeting diffMeetingDescription = new Meeting(otherDescription, testDate);
Meeting diffMeetingTime = new Meeting(testDescription, otherDate);
Meeting testMeeting = new Meeting(TEST_DESCRIPTION, TEST_DATE);
Meeting diffMeetingDescription = new Meeting(TEST_OTHERDESCRIPTION, TEST_DATE);
Meeting diffMeetingTime = new Meeting(TEST_DESCRIPTION, otherDate);
MeetDateTime testDate = new MeetDateTime("12/04/2023 12:00");


Expand Down Expand Up @@ -53,8 +53,8 @@ public void asSymmetricHashcode() {

@Test
public void toStringMethod() {
Meeting testMeeting = new Meeting(testDescription, testDate);
String expected = testDate + ":" + testDescription;
Meeting testMeeting = new Meeting(TEST_DESCRIPTION, TEST_DATE);
String expected = TEST_DATE + ":" + TEST_DESCRIPTION;
assertEquals(expected, testMeeting.toString());
}

Expand Down

0 comments on commit 01ee036

Please sign in to comment.