Skip to content

Commit

Permalink
Remove traces of module in AvailabilityTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
whitesnowx committed Mar 12, 2024
1 parent 7c271d6 commit 3849391
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/java/staffconnect/model/person/AvailabilityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ public class AvailabilityTest {

@Test
public void constructor_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> new Module(null));
assertThrows(NullPointerException.class, () -> new Availability(null));
}

@Test
public void constructor_invalidModule_throwsIllegalArgumentException() {
public void constructor_invalidAvailability_throwsIllegalArgumentException() {
String invalidAvailability = "";
assertThrows(IllegalArgumentException.class, () -> new Availability(invalidAvailability));
}

@Test
public void isValidAvailability() {
// null module code
// null availability
assertThrows(NullPointerException.class, () -> Availability.isValidAvailability(null));

// invalid module code
// invalid availability
assertFalse(Availability.isValidAvailability("")); // empty string
assertFalse(Availability.isValidAvailability(" ")); // spaces only
assertFalse(Availability.isValidAvailability("m")); // 1 letter only
Expand All @@ -42,7 +42,7 @@ public void isValidAvailability() {
assertFalse(Availability.isValidAvailability("thu")); // uncompleted syllable
assertFalse(Availability.isValidAvailability("sun day")); // space between syllable

// valid module code
// valid availability
assertTrue(Availability.isValidAvailability("mon")); // first syllable tuesday
assertTrue(Availability.isValidAvailability("tues")); // first syllable tuesday
assertTrue(Availability.isValidAvailability("wed")); // first syllable wednesday
Expand Down

0 comments on commit 3849391

Please sign in to comment.