Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Meeting class and the corresponding test #74

Merged
merged 7 commits into from
Mar 15, 2024

Conversation

Pluiexo
Copy link

@Pluiexo Pluiexo commented Mar 14, 2024

The commands to manipulate meeting will be in the next pull request. Closes #43

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.45%. Comparing base (6c4cc36) to head (5031b3f).
Report is 11 commits behind head on master.

Files Patch % Lines
.../main/java/staffconnect/model/meeting/Meeting.java 86.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #74      +/-   ##
============================================
+ Coverage     76.20%   77.45%   +1.25%     
- Complexity      444      487      +43     
============================================
  Files            73       79       +6     
  Lines          1408     1495      +87     
  Branches        139      146       +7     
============================================
+ Hits           1073     1158      +85     
- Misses          305      307       +2     
  Partials         30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Pluiexo Pluiexo force-pushed the branch-Meeting-Attribute branch from a39ea0f to 4f80e1e Compare March 15, 2024 05:01
Copy link
Collaborator

@tsulim tsulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I found your code easy to read.
I noted a few portions that you might have missed out. Consider giving the code a thorough look through for any parts that you may miss before you create pull request.

src/main/java/staffconnect/model/meeting/Meeting.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/Meeting.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/Description.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/Description.java Outdated Show resolved Hide resolved
Comment on lines 27 to 30
// null Date
assertThrows(NullPointerException.class, () -> MeetDateTime.isValidMeetDateTime(null));

// invalid Meeting Date code
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you could standardize the comments?

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed out this one too.

Comment on lines 16 to 43
@Test
public void constructor_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> new Name(null));
}

@Test
public void constructor_invalidName_throwsIllegalArgumentException() {
String invalidDescription = "";
assertThrows(IllegalArgumentException.class, () -> new Name(invalidDescription));
}

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

// invalid name
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
assertTrue(Name.isValidName("meeting")); // alphabets only
assertTrue(Name.isValidName("12345")); // numbers only
assertTrue(Name.isValidName("meeting at for 2nd finals")); // alphanumeric characters
assertTrue(Name.isValidName("Crush the exam")); // with capital letters
assertTrue(Name.isValidName("Super hard midterm with finals and project combined 2nd")); // long names
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it is Description instead of Name?

@tsulim tsulim added this to the v1.2 milestone Mar 15, 2024
Copy link
Collaborator

@iynixil iynixil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! minor nits
edit: same problems as said above, but also a few different ones

src/main/java/staffconnect/model/meeting/Description.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/Description.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/MeetDateTime.java Outdated Show resolved Hide resolved
src/main/java/staffconnect/model/meeting/Meeting.java Outdated Show resolved Hide resolved
@Pluiexo
Copy link
Author

Pluiexo commented Mar 15, 2024

Overall, I found your code easy to read. I noted a few portions that you might have missed out. Consider giving the code a thorough look through for any parts that you may miss before you create pull request.

Thanks has been fixed, I did this in the morning, so quite a number of errors missed out :(

@Pluiexo Pluiexo force-pushed the branch-Meeting-Attribute branch from 3990e05 to 01ee036 Compare March 15, 2024 07:00
Copy link
Collaborator

@tsulim tsulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@tsulim tsulim merged commit 8e6fe5c into AY2324S2-CS2103-F08-3:master Mar 15, 2024
5 checks passed
@tsulim tsulim added the type.Task Something that needs to be done, but not a story, bug, or an epic. label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type.Task Something that needs to be done, but not a story, bug, or an epic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Meeting class
3 participants