From ff22c698127e00b850a3348da12cbd3dd5ed5d8c Mon Sep 17 00:00:00 2001 From: potaotototo Date: Sat, 2 Nov 2024 21:01:27 +0800 Subject: [PATCH] Add comments --- src/test/java/tuteez/model/person/lesson/DayTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/tuteez/model/person/lesson/DayTest.java b/src/test/java/tuteez/model/person/lesson/DayTest.java index 41d982d427f..7ea6e4b129b 100644 --- a/src/test/java/tuteez/model/person/lesson/DayTest.java +++ b/src/test/java/tuteez/model/person/lesson/DayTest.java @@ -10,6 +10,7 @@ public class DayTest { @Test public void isValidDay_validInputs_returnsTrue() { + // EP: fully spelt out weekdays assertTrue(Day.isValidDay("monday")); assertTrue(Day.isValidDay("tuesday")); assertTrue(Day.isValidDay("wednesday")); @@ -18,6 +19,7 @@ public void isValidDay_validInputs_returnsTrue() { assertTrue(Day.isValidDay("saturday")); assertTrue(Day.isValidDay("sunday")); + // EP: short form for weekdays assertTrue(Day.isValidDay("mon")); assertTrue(Day.isValidDay("tue")); assertTrue(Day.isValidDay("wed")); @@ -26,6 +28,7 @@ public void isValidDay_validInputs_returnsTrue() { assertTrue(Day.isValidDay("sat")); assertTrue(Day.isValidDay("sun")); + // EP: random capitalisation of weekdays assertTrue(Day.isValidDay("Monday")); assertTrue(Day.isValidDay("TUESDAY")); assertTrue(Day.isValidDay("wEdNeSdAy")); @@ -35,12 +38,14 @@ public void isValidDay_validInputs_returnsTrue() { @Test public void isValidDay_invalidInputs_returnsFalse() { + // EP: invalid string inputs assertFalse(Day.isValidDay("not a day")); assertFalse(Day.isValidDay("mon day")); assertFalse(Day.isValidDay("mondays")); assertFalse(Day.isValidDay("tues")); assertFalse(Day.isValidDay("thur")); + // EP: empty input assertFalse(Day.isValidDay("")); assertFalse(Day.isValidDay(" ")); assertFalse(Day.isValidDay("\t"));