Skip to content

Commit

Permalink
Merge pull request #258 from saiutkarsh33/update-ug-name
Browse files Browse the repository at this point in the history
Update UG and tests
  • Loading branch information
saiutkarsh33 authored Apr 11, 2024
2 parents 92775d6 + 03b0672 commit 2b11168
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
39 changes: 22 additions & 17 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,11 @@ The quick reference is meant for **fast and reliable** lookup of commands and th

### <i class="fa-solid fa-chalkboard"></i> Name/Rename CS course : `setcrs`

Names the course in question.
Sets the course code in question.

Format: `setcrs COURSE_NAME`
Format: `setcrs COURSE_CODE`

Duplicate course are not allowed.
Courses are case-insensitive.
Course codes are case-insensitive.
Course code should follow the format "XX1234Y", Y is optional.

<markdown class="d-print-none">---</markdown>
Expand All @@ -309,6 +308,8 @@ Format: `addstu n/NAME nn/NUSNET [p/PHONE] [e/EMAIL] [m/MAJOR] [t/TAG]…​`

* Add a student with the given details.
* The name and nusnet id must be provided. And nusnet id must be unique.

* Name cannot be empty or spaces only, contain only alphabets and cannot have double spaces.
* All the remaining fields are optional. If values are not provided to optional fields, they will be set to a placeholder value under the hood (e.g., `Major not provided` for `MAJOR` field).

<box type="tip" light>
Expand Down Expand Up @@ -887,16 +888,20 @@ If you have more than one copy of TAPro running, the application may not functio
## <i class="fa-solid fa-table-list"></i> Command summary
| Action | Format, Examples |
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Add Student** | `addstu n/NAME p/PHONE_NUMBER e/EMAIL nn/NUSNET_ID m/MAJOR [t/TAG]…​` <br> e.g., `addstu n/James Ho p/22224444 e/jamesho@example.com nn/E1234567 m/Computer Science t/friend t/colleague` |
| **Clear** | `clear` |
| **Delete Student** | `delstu nn/NUSNET_ID`<br> e.g., `delstu nn/E0957499` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [m/MAJOR] [t/TAG]…​`<br> e.g.,`edit 2 n/James Lee e/jameslee@example.com` |
| **Mark** | `mark nn/NUSNET_ID wk/WEEK_NUMBER`<br> e.g., `mark nn/E1234567 wk/3` |
| **Unmark** | `unmark nn/NUSNET_ID wk/WEEK_NUMBER`<br> e.g., `unmark nn/E1234567 wk/3` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]…​`<br> e.g., `find James Jake` |
| **Set Course** | `setcrs COURSE_NAME` |
| **List** | `list` |
| **Help** | `help` |
| **Exit** | `exit` |
## Command summary
| Action | Format, Examples |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Add Student** | `addstu n/NAME p/PHONE_NUMBER e/EMAIL nn/NUSNET_ID m/MAJOR [t/TAG]…​` <br> e.g., `add n/James Ho p/22224444 e/jamesho@example.com nn/e1234567 m/Computer Science t/friend t/colleague` |
| **Clear** | `clear` |
| **Delete Student** | `delstu nn/NUSNET_ID`<br> e.g., `delstu nn/e0957499` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [m/MAJOR] [t/TAG]…​`<br> e.g.,`edit 2 n/James Lee e/jameslee@example.com` |
| **Mark** | `mark nn/NUSNET_ID wk/WEEK_NUMBER`<br> e.g., `mark nn/e1234567 wk/3` |
| **Unmark** | `unmark nn/NUSNET_ID wk/WEEK_NUMBER`<br> e.g., `unmark nn/e1234567 wk/3` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **Set Course** | `setcrs COURSE_CODE` |
| **List** | `list` |
| **Help** | `help` |
| **Exit** | `exit` |
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class SetCourseCommand extends Command {

public static final String MESSAGE_USAGE = CommandMessageUsageUtil.generateMessageUsage(
COMMAND_WORD,
"Sets the course name. ",
"Sets the course code. ",
PARAMETER_COURSE_CODE);

public static final String MESSAGE_SUCCESS = "Successfully updated course name";
public static final String MESSAGE_SUCCESS = "Successfully updated course code";


private final Course course;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Name {
+ "and should not be blank";

/*
* The first character of the address must not be a whitespace,
* The first character of the name must not be a whitespace,
* otherwise " " (a blank string) becomes a valid input.
*/
public static final String VALIDATION_REGEX = "[A-Z][a-z]*(\\s[A-Z][a-z]*)*";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.commands.exceptions.InappropriateMethodCallAssertionError;
import seedu.address.model.AddressBook;
import seedu.address.model.CourseName;
import seedu.address.model.Model;
Expand All @@ -30,6 +29,7 @@
import seedu.address.model.ReadOnlyUserPrefs;
import seedu.address.model.person.NusNet;
import seedu.address.model.person.Person;
import seedu.address.testutil.InappropriateMethodCallAssertionError;
import seedu.address.testutil.PersonBuilder;


Expand Down
1 change: 1 addition & 0 deletions src/test/java/seedu/address/model/person/NameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void isValidName() {
assertFalse(Name.isValidName("peter*")); // contains non-alphanumeric characters
assertFalse(Name.isValidName("12345")); // numbers only
assertFalse(Name.isValidName("Peter The 2nd")); // alphanumeric characters
assertFalse(Name.isValidName("Peter T")); // Double space

// valid name
assertTrue(Name.isValidName("Peter Jack")); // alphabets only
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.logic.commands.exceptions;
package seedu.address.testutil;

/**
* InappropriateMethodCallAssertionError extends AssertionError to provide a more specific error indication
Expand Down

0 comments on commit 2b11168

Please sign in to comment.