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

test_that("update_frequency_with_desired_value works", {
  scenario_example <- create_scenario(
    system.file("input_1culture_2pop.xlsx", package = "ambre")
  )
  result <- update_frequency_with_desired_value(scenario = scenario_example, 
                                                                frequency = c(2L,3L))
  expect_equal(object = result$config[[1]]$exposure$value[[2]], 
               expected = 2) 
  expect_equal(object = result$config[[2]]$exposure$value[[2]], 
               expected = 3)
})

test_that("update_frequency_with_desired_value error", {
  scenario_example <- create_scenario(
    system.file("input_1culture_2pop.xlsx", package = "ambre")
  )
  
  expect_error(object = update_frequency_with_desired_value(scenario = scenario_example, 
                                                                frequency = 2), 
               regexp = "A frequency value is required for all lines in the scenario") 
  expect_error(object = update_frequency_with_desired_value(scenario = scenario_example, 
                                                                frequency = c(2.2,3)), 
               regexp = "'frequency' must be an integer vector (e.g. c(1L, 2L, 3L)).",
               fixed = TRUE)
})
