From 94d7b160bb07f7af3b60d9caa77ce592b30758b5 Mon Sep 17 00:00:00 2001 From: Brooks Date: Thu, 30 Nov 2023 08:08:04 +0000 Subject: [PATCH] added test for getModelData --- tests/testthat/test-simulation.R | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/testthat/test-simulation.R diff --git a/tests/testthat/test-simulation.R b/tests/testthat/test-simulation.R new file mode 100644 index 0000000..194800c --- /dev/null +++ b/tests/testthat/test-simulation.R @@ -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")) +}) \ No newline at end of file