-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Meeting class and the corresponding test #74
Conversation
Codecov ReportAttention: Patch coverage is
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. |
a39ea0f
to
4f80e1e
Compare
There was a problem hiding this 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.
// null Date | ||
assertThrows(NullPointerException.class, () -> MeetDateTime.isValidMeetDateTime(null)); | ||
|
||
// invalid Meeting Date code |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
@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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this 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
Thanks has been fixed, I did this in the morning, so quite a number of errors missed out :( |
3990e05
to
01ee036
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
The commands to manipulate meeting will be in the next pull request. Closes #43