Skip to content

Commit cbe54a3

Browse files
committed
test(functional): add test with no arrivals (#18)
1 parent 04c41bd commit cbe54a3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/testthat/test-functionaltest.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,26 @@ patrick::with_parameters_test_that(
254254
)
255255

256256

257+
test_that("no arrivals if high inter-arrival time for all patients", {
258+
# Run model with extremely large number of nurses
259+
param <- parameters(
260+
warm_up_period = 1000L, data_collection_period = 1000L,
261+
cores = 1L, number_of_runs = 1L
262+
)
263+
for (key in names(param$dist_config)) {
264+
if (grepl("arrival", key)) {
265+
param$dist_config[[key]]$params$ mean <- 10000000L
266+
}
267+
}
268+
results <- runner(param = param)
269+
270+
# Check that there are no arrivals
271+
expect_true(nrow(results$arrivals) == 0)
272+
expect_true(nrow(results$occupancy) == 0)
273+
expect_true(length(results$occupancy_stats) == 0)
274+
})
275+
276+
257277
# -----------------------------------------------------------------------------
258278
# 3. Seeds
259279
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)