Skip to content

Commit

Permalink
Update UG and add test cases
Browse files Browse the repository at this point in the history
Updated UG to resolve minor discrepancies and added test cases checking
for valid NRIC involving non-caps letter inputs.
  • Loading branch information
kohkaijie committed Nov 10, 2023
1 parent 5494749 commit 7d34310
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
16 changes: 8 additions & 8 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: User Guide
---

MediLink Contacts(MLC) is a **desktop app for managing patients and doctors details, optimized for use via a Command
MediLink Contacts (MLC) is a **desktop app for managing patients and doctors details, optimized for use via a Command
Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, MLC
can get your patients management tasks done faster than traditional GUI apps.

Expand All @@ -19,16 +19,16 @@ can get your patients management tasks done faster than traditional GUI apps.
1. Ensure you have Java `11` or above installed in your Computer. If you don't, install it for your relevant operating
system at this link https://www.oracle.com/sg/java/technologies/javase/jdk11-archive-downloads.html

1. Download the latest `MediLink.jar` from [here](https://github.com/AY2324S1-CS2103T-T09-3/tp/releases).
2. Download the latest `MediLink.jar` from [here](https://github.com/AY2324S1-CS2103T-T09-3/tp/releases).

1. Copy the file to the folder you want to use as the _home folder_ for your MLC.
3. Copy the file to the folder you want to use as the _home folder_ for your MLC.

1. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar MediLink.jar` command
4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar MediLink.jar` command
to run the application.<br>
A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
![Ui](images/Ui.png)

1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will
5. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will
open the help window.<br>
Some example commands you can try:

Expand All @@ -43,7 +43,7 @@ can get your patients management tasks done faster than traditional GUI apps.

* `exit` : Exits the app.

1. Refer to the [Features](#features) below for details of each command.
6. Refer to the [Features](#features) below for details of each command.

--------------------------------------------------------------------------------------------------------------------
## Parameters
Expand Down Expand Up @@ -93,7 +93,7 @@ The list below contains the parameters that are used in various commands as well

### Viewing help : `help`

Shows a message explaning how to access the help page.
Shows a message explaining how to access the help page.

![help message](images/helpMessage.png)

Expand Down Expand Up @@ -228,7 +228,7 @@ Examples:

### Listing all persons : `list`

Shows a list of all persons in the MediLink Contacts.
Shows a list of all persons and appointments in the MediLink Contacts.

Format: `list`

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Ic.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Ic {

public static final String MESSAGE_CONSTRAINTS =
"Ic should start with S or T, followed by 7 numbers, and ends with a letter. "
+ "Letters must be in all caps. Empty strings are not allowed\n";
+ "Letters inputs are case-insensitive. Empty strings are not allowed\n";
public static final String VALIDATION_REGEX = "^[TS]\\d{7}[A-Z]$";
public final String value;

Expand Down
33 changes: 33 additions & 0 deletions src/test/java/seedu/address/logic/parser/ParserUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Ic;
import seedu.address.model.person.Name;
import seedu.address.model.person.Phone;
import seedu.address.model.tag.Tag;
Expand All @@ -25,13 +26,17 @@ public class ParserUtilTest {
private static final String INVALID_PHONE = "+651234";
private static final String INVALID_ADDRESS = " ";
private static final String INVALID_EMAIL = "example.com";
private static final String INVALID_IC1 = "Y9834876G";
private static final String INVALID_IC2 = "T934865H";
private static final String INVALID_PATIENT_TAG = "priority: HIGHEST";
private static final String INVALID_DOCTOR_TAG1 = "NURSE";

private static final String VALID_NAME = "Rachel Walker";
private static final String VALID_PHONE = "123456";
private static final String VALID_ADDRESS = "123 Main Street #0505";
private static final String VALID_EMAIL = "rachel@example.com";
private static final String VALID_IC1 = "T1234567H";
private static final String VALID_IC2 = "t1234567h";
private static final String VALID_TAG1 = "FRIENDS";
private static final String VALID_TAG2 = "STUDENT";
private static final String VALID_PATIENT_TAG1 = "priority: LOW";
Expand Down Expand Up @@ -153,6 +158,34 @@ public void parseEmail_validValueWithWhitespace_returnsTrimmedEmail() throws Exc
assertEquals(expectedEmail, ParserUtil.parseEmail(emailWithWhitespace));
}

@Test
public void parseIc_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> ParserUtil.parseIc((String) null));
}

@Test
public void parseIc_invalidStartingCharacter_throwsParseException() {
assertThrows(ParseException.class, () -> ParserUtil.parseIc(INVALID_IC1));
}

@Test
public void parseIc_invalidNumbers_throwsParseException() {
assertThrows(ParseException.class, () -> ParserUtil.parseIc(INVALID_IC2));
}

@Test
public void parseIc_validIcWithCaps_returnsIc() throws Exception {
Ic expectedIc = new Ic(VALID_IC1);
assertEquals(expectedIc, ParserUtil.parseIc(VALID_IC1));
}

@Test
public void parseIc_validIcWithoutCaps_returnsIc() throws Exception {
String inputIc = VALID_IC2.toUpperCase();
Ic expectedIc = new Ic(inputIc);
assertEquals(expectedIc, ParserUtil.parseIc(VALID_IC2));
}

@Test
public void parseTag_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> ParserUtil.parseTag(null));
Expand Down
1 change: 1 addition & 0 deletions src/test/java/seedu/address/model/person/IcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void isValidIc() {
assertFalse(Ic.isValidIc(" ")); // spaces only
assertFalse(Ic.isValidIc("S333444Z")); // only 6 numbers included
assertFalse(Ic.isValidIc("G2223331H")); // starting alphabet not S or T
assertFalse(Ic.isValidIc("s2223331H")); // alphabets not in caps

// valid nric
assertTrue(Ic.isValidIc("S0345999H")); // starting alphabet S
Expand Down

0 comments on commit 7d34310

Please sign in to comment.