Here's the code for the test. The other functions code are the same as in the final videos.
(defspec simulates-a-day-in-the-hospital-and-loses-no-patient
(prop/for-all [hospital-before hospital-gen]
(let [situation {:hospital hospital-before :difference 0}
actions (gen/generate (actions-gen hospital-before))
situation-after (reduce perform-an-action situation actions)
hospital-after (:hospital situation-after)
difference (:difference situation-after)]
(println (total-of-patients hospital-before) (total-of-patients hospital-after) difference)
(is (= (- (total-of-patients hospital-after) (total-of-patients hospital-before))
difference))
)))
Here are the results if I run the test once with the seed 1655611696461