diff --git a/events/2024-11-05-BYOM_score_calculation.html b/events/2024-11-05-BYOM_score_calculation.html index c2ccf5c..f322f32 100644 --- a/events/2024-11-05-BYOM_score_calculation.html +++ b/events/2024-11-05-BYOM_score_calculation.html @@ -188,10 +188,10 @@

Constraint streams required skill (good way)

Constraint Streams

- - - - + + + +
@@ -201,18 +201,6 @@

Constraint Streams

-
- - - - -
-
- - - - -
@@ -222,10 +210,15 @@

Constraint Streams

- - - - + + +
+
+ + + + +
@@ -234,19 +227,25 @@

Constraint Streams

- - - - - + + + +
- - + + + + +
+
+ + + +
-

Unit testing

@@ -257,6 +256,24 @@

If it isn't tested, it doesn't work.

+
+

Unit test

+
@Test
+void requiredSkill() {
+    Employee employee = new Employee(
+        "Amy", Set.of(), null, null, null);
+    constraintVerifier.verifyThat(EmployeeSchedulingConstraintProvider::requiredSkill)
+        .given(employee,
+            new Shift("1", DAY_START_TIME, DAY_END_TIME, "Location", "Plumber", employee))
+        .penalizes(1);
+    employee = new Employee(
+        "Beth", Set.of("Skill"), null, null, null);
+    constraintVerifier.verifyThat(EmployeeSchedulingConstraintProvider::requiredSkill)
+        .given(employee,
+            new Shift("2", DAY_START_TIME, DAY_END_TIME, "Location", "Skill", employee))
+        .penalizes(0);
+}
+
@@ -265,6 +282,7 @@

If it isn't tested, it doesn't work.

Score corruption

+