# WARNING - Generated by {fusen} from dev/flat_scenario.Rmd: do not edit by hand # nolint: line_length_linter.

test_that("update_concentration works", {
  scenario_test <- create_scenario(
  system.file("input_1culture_2pop.xlsx", package = "ambre")
)

  pathogenName <- c("Norovirus", "Rotavirus")
  concentration_custom <- data.frame(PathogenName = pathogenName,
                                     min = c(1, 10),
                                     max = c(2,20),
                                     type = c("uniform", "uniform"))
  
  scenario_updated_patho <- update_pathogen(scenario = scenario_test, pathoName = pathogenName)
  result <- update_concentration(scenario = scenario_updated_patho ,
                       concentration = concentration_custom)
  
  result_noro <- dplyr::filter(result$config[[1]]$inflow, PathogenName == "Norovirus")
  
  expect_equal(object = result_noro$min, expected = 1)
  expect_equal(object = result_noro$max, expected = 2)
  
  result_rota <- dplyr::filter(result$config[[1]]$inflow, PathogenName == "Rotavirus")
  expect_equal(object = result_rota$min, expected = 10)
  expect_equal(object = result_rota$max, expected = 20)
  
})
