diff --git a/src/main/java/staffconnect/model/meeting/MeetDateTime.java b/src/main/java/staffconnect/model/meeting/MeetDateTime.java index c36a98b8b4c..5467c076be6 100644 --- a/src/main/java/staffconnect/model/meeting/MeetDateTime.java +++ b/src/main/java/staffconnect/model/meeting/MeetDateTime.java @@ -21,7 +21,7 @@ public class MeetDateTime { /** - * Constructs a {@code MeetDate}. + * Constructs a {@code MeetDateTime}. * * @param date A valid date. */ diff --git a/src/test/java/staffconnect/model/meeting/DescriptionTest.java b/src/test/java/staffconnect/model/meeting/DescriptionTest.java index 19619d9531f..4f8a60670d8 100644 --- a/src/test/java/staffconnect/model/meeting/DescriptionTest.java +++ b/src/test/java/staffconnect/model/meeting/DescriptionTest.java @@ -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 diff --git a/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java b/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java index 7819dcdb2bb..c5877282e0c 100644 --- a/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java +++ b/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java @@ -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 @@ -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 } diff --git a/src/test/java/staffconnect/model/meeting/MeetingTest.java b/src/test/java/staffconnect/model/meeting/MeetingTest.java index 11d1b4086b0..3b7fe7e1b8b 100644 --- a/src/test/java/staffconnect/model/meeting/MeetingTest.java +++ b/src/test/java/staffconnect/model/meeting/MeetingTest.java @@ -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"); @@ -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()); }