# WARNING - Generated by {fusen} from dev/flat_simulate_exposure.Rmd: do not edit by hand # nolint: line_length_linter. test_that("simulate_exposure returns expected structure", { scenario_test <- create_scenario(system.file("input_1culture_2pop.xlsx", package = "ambre")) scenario_updated <- update_pathogen(scenario = scenario_test, pathoName = c("Campylobacter jejuni", "Rotavirus")) result <- simulate_exposure(config = scenario_updated$config[[1]]) expect_is(result, "list") expect_type(result$volumes, "list") expect_s3_class(result$volumes$events, "data.frame") expect_true(all(c("repeatID", "eventID", "volume_perEvent") %in% colnames(result$volumes$events))) expect_true(nrow(result$volumes$events) > 0) }) test_that("simulate_exposure handles debug parameter", { scenario_test <- create_scenario(system.file("input_1culture_2pop.xlsx", package = "ambre")) scenario_updated <- update_pathogen(scenario = scenario_test, pathoName = c("Campylobacter jejuni", "Rotavirus")) # Test with debug=TRUE (catIf uses cat(), so output goes to stdout) expect_output(simulate_exposure(config = scenario_updated$config[[1]], debug = TRUE), "Simulated exposure: volume per event") # Test with debug=FALSE expect_silent(simulate_exposure(config = scenario_updated$config[[1]], debug = FALSE)) })