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 lesson class and fields #68

Merged
merged 7 commits into from
Oct 6, 2020

Conversation

hyngkng
Copy link
Collaborator

@hyngkng hyngkng commented Oct 5, 2020

No description provided.

@hyngkng hyngkng added this to the v1.2 milestone Oct 5, 2020
@hyngkng hyngkng self-assigned this Oct 5, 2020
@hyngkng hyngkng linked an issue Oct 5, 2020 that may be closed by this pull request
Copy link
Collaborator

@ChooJiaXin ChooJiaXin 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 :) Just a few minor nits.

Comment on lines 33 to 38
// valid name
assertTrue(LessonName.isValidLessonName("Lecture")); // alphabets only
assertTrue(LessonName.isValidLessonName("Tutorial")); // numbers only
assertTrue(LessonName.isValidLessonName("Laboratory")); // alphanumeric characters
assertTrue(LessonName.isValidLessonName("Recitation")); // with capital letters
assertTrue(LessonName.isValidLessonName("Sectional Teachings")); // 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.

The test cases look good! Minor nitpick, the comments next to the valid test cases do not match what is being tested. Also, if the lesson names do not accept numerals in the name, you may want to consider changing the validation regex to only accept alphabets :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed these tests because Assignment already tests Name. :) Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

okie

Comment on lines 30 to 31
assertFalse(Time.isValidDeadline("1200 1999-10-10")); // invalid time

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice test case :)

import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents an assignment's module code in the address book.

Choose a reason for hiding this comment

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

Perhaps comment can be changed to just 'module code'? Since it is applicable to both lessons and assignments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Amended. Changed to Task instead. :)

Copy link
Collaborator

@itsjerryho itsjerryho left a comment

Choose a reason for hiding this comment

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

LGTM! Just one small feedback

public class ModuleCode {

public static final String MESSAGE_CONSTRAINTS =
"Module codes should begin with 2 or 3 alphabets, have 4 numbers and end with an alphabet/number.\n"
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 module code might not have to end with an alphabet or number all the time right haha. maybe can phrase it '... have 4 numbers and may end with an alphabet.'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Amended!

@ChooJiaXin ChooJiaXin added the enhancement New feature or request label Oct 6, 2020
Copy link
Collaborator

@ChooJiaXin ChooJiaXin 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 nitpicks on the naming but nothing that can't be easily fixed in v1.2b :) LGTM

Comment on lines 16 to 24
public Lesson(Name name, Deadline deadline, ModuleCode moduleCode) {
super(name, deadline, moduleCode);
requireAllNonNull(name, deadline, moduleCode);
}

public Deadline getDeadline() {
return super.getTime();
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming the deadline field time may be more appropriate for the Lesson class as it doesn't really make sense for a Lesson to have a deadline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Amended!

Copy link
Collaborator

@ChooJiaXin ChooJiaXin left a comment

Choose a reason for hiding this comment

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

LGTM :)

@ChooJiaXin ChooJiaXin merged commit 61aa8e4 into AY2021S1-CS2103T-F11-3:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Lesson class
4 participants