diff --git a/src/test/java/staffconnect/model/meeting/DescriptionTest.java b/src/test/java/staffconnect/model/meeting/DescriptionTest.java index 22d0542b0a0..19619d9531f 100644 --- a/src/test/java/staffconnect/model/meeting/DescriptionTest.java +++ b/src/test/java/staffconnect/model/meeting/DescriptionTest.java @@ -46,6 +46,7 @@ public void isValidDescription() { @Test public void equals() { Description description = new Description("Valid Description"); + MeetDateTime testDate = new MeetDateTime("12/04/2023 12:00"); // same values -> returns true assertEquals(description, new Description("Valid Description")); @@ -59,6 +60,9 @@ public void equals() { // different types -> returns false assertNotEquals(5.0f, description); + //Different object type -> returns false + assertFalse(description.equals(testDate)); + // different values -> returns false assertNotEquals(description, new Name("Other valid description")); } diff --git a/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java b/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java index 40c38a0eeea..7819dcdb2bb 100644 --- a/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java +++ b/src/test/java/staffconnect/model/meeting/MeetDateTimeTest.java @@ -48,6 +48,7 @@ public void isValidMeetDate() { @Test public void equals() { MeetDateTime date = new MeetDateTime("20/01/2023 12:00"); + Description testDescription = new Description("Valid Description"); // same values -> returns true assertEquals(date, new MeetDateTime("20/01/2023 12:00")); @@ -61,6 +62,9 @@ public void equals() { // different types -> returns false assertNotEquals(1234, date); + //Different object type -> returns false + assertFalse(date.equals(testDescription)); + // different values -> returns false assertNotEquals(date, new MeetDateTime("15/02/2024 12:00")); } diff --git a/src/test/java/staffconnect/model/meeting/MeetingTest.java b/src/test/java/staffconnect/model/meeting/MeetingTest.java index 0d1749f5ef5..11d1b4086b0 100644 --- a/src/test/java/staffconnect/model/meeting/MeetingTest.java +++ b/src/test/java/staffconnect/model/meeting/MeetingTest.java @@ -1,6 +1,7 @@ package staffconnect.model.meeting; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import org.junit.jupiter.api.Test; @@ -17,6 +18,8 @@ public void equals() { Meeting testMeeting = new Meeting(testDescription, testDate); Meeting diffMeetingDescription = new Meeting(otherDescription, testDate); Meeting diffMeetingTime = new Meeting(testDescription, otherDate); + MeetDateTime testDate = new MeetDateTime("12/04/2023 12:00"); + // same values -> returns true assertEquals(testMeeting, new Meeting(new Description("Valid description"), @@ -31,6 +34,9 @@ public void equals() { // different type -> returns false assertNotEquals(5, testMeeting); + //Different object type -> returns false + assertFalse(testMeeting.equals(testDate)); + // different description -> returns false assertNotEquals(testMeeting, diffMeetingDescription);