Skip to content

Commit

Permalink
added test for getModelData
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooks committed Nov 30, 2023
1 parent 47b8861 commit 94d7b16
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-simulation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Test for getModelData
test_that("getModelData returns a data frame with correct columns", {

mock_sim_data <- data.frame(
simulation = 1:5,
dose = rnorm(5),
model1 = rnorm(5),
model2 = rnorm(5)
)
mock_model_name <- "model1"

result <- getModelData(sim_data = mock_sim_data, model_name = mock_model_name)

# Assert that the result is a data frame
expect_true(is.data.frame(result))
# Assert that the data frame has the correct number of columns
expect_equal(ncol(result), 3)
# Assert that the data frame has the correct column names
expect_equal(colnames(result), c("simulation", "dose", "response"))
})

0 comments on commit 94d7b16

Please sign in to comment.