Skip to content

Commit

Permalink
Fix meeting test
Browse files Browse the repository at this point in the history
  • Loading branch information
chewbum committed Mar 21, 2024
1 parent eadd963 commit dbe0026
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ public Command parseCommand(String userInput) throws ParseException {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLIENT_INDEX;
import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_INDEX;

import java.util.stream.Stream;

import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.DeleteMeetingCommand;
import seedu.address.logic.parser.exceptions.ParseException;

import java.time.LocalDateTime;
import java.util.stream.Stream;

/**
* Parses input arguments and creates a new DeleteCommand object
*/
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/seedu/address/model/meeting/Meeting.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ public Meeting(String description, LocalDateTime dateTime) {
this.client = null;
}

public Meeting(String description, LocalDateTime dateTime) {
requireAllNonNull(description, dateTime);
checkArgument(isValidDescription(description), MESSAGE_CONSTRAINTS);
checkArgument(isValidDateTime(dateTime.format(formatter)), MESSAGE_INVALID_DATE_TIME);
this.description = description;
this.dateTime = dateTime;
this.client = null;
}

/**
* Returns true if a given string is a valid descrption
* @param test String to be tested
Expand Down
10 changes: 9 additions & 1 deletion src/test/java/seedu/address/logic/commands/CommandTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.logic.parser.CliSyntax.*;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLIENT_INDEX;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DATETIME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_INDEX;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;
import static seedu.address.testutil.Assert.assertThrows;

import java.util.ArrayList;
Expand Down
12 changes: 7 additions & 5 deletions src/test/java/seedu/address/model/meeting/MeetingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ public void equals() {
// same values -> returns true
Meeting meetingWithAliceCopy = TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0);

assertTrue(TypicalMeetings.ALICE_WITH_MEETING.equals(meetingWithAliceCopy));
assertTrue(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0).equals(meetingWithAliceCopy));

// same object -> returns true
assertTrue(TypicalMeetings.ALICE_WITH_MEETING.equals(TypicalMeetings.ALICE_WITH_MEETING));
assertTrue(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0)
.equals(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0)));

// null -> returns false
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.equals(null));
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0).equals(null));

// different type -> returns false
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.equals(5));
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0).equals(5));

// different meeting -> returns false
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.equals(TypicalMeetings.BENSON_WITH_MEETING));
assertFalse(TypicalMeetings.ALICE_WITH_MEETING.getMeetings().get(0)
.equals(TypicalMeetings.BENSON_WITH_MEETING));
}

@Test
Expand Down

0 comments on commit dbe0026

Please sign in to comment.