# test 1 - remove by name -----------------------------------------
path <- system.file("testdata", "three1", package = "mm.reoptimise")
scenario_list <- create_scenario_list(path)
scenarios <- summarise_scenarios(scenario_list)$name
updated_scenario_list <- remove_scenario(scenario_list, user_name = scenarios[1])
test_that("output is correct type and size",{
expect_equal(length(updated_scenario_list),
length(scenario_list)-1)
})
# test 2 - remove by unique_id ----------------------------------------------
path <- system.file("testdata", "three1", package = "mm.reoptimise")
scenario_list <- create_scenario_list(path)
summarise_scenarios(scenario_list)$unique_id
updated_scenario_list <- remove_scenario(scenario_list,
user_unique_id = 100001)
test_that("output is correct type and size",{
expect_equal(length(updated_scenario_list),
length(scenario_list)-1)
df <- summarise_scenarios(updated_scenario_list)
expect_equal(nrow(df),
length(scenario_list)-1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.